I spent countless hours last week getting a flow to work using some variables, but I log in this week and see that they aren't working anymore. I gett the following error:
"InvalidTemplate. Unable to process template language expressions in action 'Manager_Approval_Email' inputs at line '1' and column '2559': 'The template language function 'if' expects its first parameter to be of type boolean. The provided value is of type 'String'. Please see https://aka.ms/logicexpressions#if for usage details.'"
This is the expression that's failing:
Solved! Go to Solution.
That's pretty much how I have it set up.
My 'Reports to Shayna' variable is reading out "False" in this test, so shouldn't it be using 'test2@companyname.com' as the result?
I was able to get it to work by using this:
if(equals(variables('reports'),"True'),'test1@company.com','test2@company.com')
Hi @Anonymous,
It seems that you have set Variables in your flow.
I made a test on my side with the similar code to check if the email has an attachment, if yes, sent email to email address1, if no, sent to the sender.
It works fine without error.
The code I am using is:
if(variables('reports'),’test1@company.com,’test2@companyname.com’)
please check the following screenshot:
Have you modified the flow with the variables? Please try to recreate the flow to see if it will wrok.
Best regards,
Mabel Mao
Hello, @Anonymous!
Have you had an opportunity to apply @v-yamao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
That's pretty much how I have it set up.
My 'Reports to Shayna' variable is reading out "False" in this test, so shouldn't it be using 'test2@companyname.com' as the result?
I was able to get it to work by using this:
if(equals(variables('reports'),"True'),'test1@company.com','test2@company.com')
Is there a way to run the 'IF' function on a boolean without initializing a Variable function. I'm running into an issue initializing a variable within an 'Apply to each'.
I'm trying to establish a line of text being added to a field into an output based on an previous boolean. Here is what I'm trying
if(equals(items('ATE')?['field'], 'true'), "RBC: ","")
Where if the boolean reads true then it adds the string "RBC: " to the output.
There are some pretty complex 'Apply to each' functions at this point in the flow and variables aren't an option.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
26 | |
25 | |
23 | |
23 | |
21 |
User | Count |
---|---|
62 | |
44 | |
41 | |
29 | |
27 |