The Switch Control issue : Power Automate

 Today I ran into a unique scenario. I had to trigger emails on dropdown change of a field in my Power App. 


Power Automate was the obvious choice but since i had 4-5 options in choice field i decided to use Switch control rather than the condition control.


Switch control is an interesting control, it not only makes your flow short, but also more efficient.


But there is a bug in the Power automate Switch control.


Lets get into it. All you need to do is replace your column Name choice with the below Coalesce Function.

coalesce(triggerBody()?['Stage']?['Value'],'Unknown')





This will help you remove the bug in Switch control which otherwise will throw an exception like below.


The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@triggerBody()?[‘Choice’]?[‘Value’]’ is not valid. It is of type ‘Null’ but is expected to be a value of type ‘String, Integer’

Comments

Popular posts from this blog

Creating Nested Galleries in Power Apps. (Parent-Child Relationship)

How to reset a datepicker control in PowerApps?

Reset () function failing to work on Edit form for Combo boxes in Power App.