Forum Discussion
Use dynamic content within If statement in expression in PowerAutomate
- Jun 27, 2022Someone on reddit suggested I turn on the experimental features for powerapps, which allows you to select dynamic content within expressions which answers my question. Thanks!
I realised I had syntax problems with my expression. I have now got this line accepted:
if(or(contains(variables('Subject'),'keyword1','1'),variables('Subject'),'keyword2','2'))
However now when I try to save I see this error message:
"Flow save failed with code 'InvalidVariableOperation' and message 'The inputs of workflow run action 'Switch' of type 'Switch' are not valid. The variable 'Subject' must be initialized before it can be used inside action 'Switch'.'."
So many question remains...can I use the dynamic content "Subject" from a "when an email arrives" block in an if expression?
I had a similar problem - but so far, the new designer has caused more issues than it solves for me (I will have to give it another try soon). I have done this with an expression like the below, where I turn 1 from SQL server into true for the sharepoint list.
if( equals(items('Apply_to_each_-_Row_returned')?['[IsActive]'],1), true,false )
Where the parent apply-to-each is named "Apply to each - Row Returned" -- note how it replaces spaces with underscores. And '[IsActive]' is the name of the column returned ... power BI adds the [].