cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kilaj1
Helper III
Helper III

Power Automate with Planner: IF Statements

I have a Flow that's linked to a Power App, that's linked to a SPO list.  When a user submits a form to this SPO list, it creates a task in planner.  The planner task creation works pretty well, but I'm trying to avoid creating multiple levels of conditional  controls that would allow me to select the planner bucket (five of them) based on the user's submission.

 

So what i did was to grab the IDs of each bucket from MS Graph and added them to variables

kilaj1_0-1626788994017.png

then I tried creating an expression in the Bucket ID field of the "Planner Create Task" control, this si a small test I attempted with two possible options

 

if(triggerOutputs()?['body/FeedbackType/Value']="Communications",variables('Communications Bucket'),if(triggerOutputs()?['body/FeedbackChannel/Value']="Programs",variables('Programs Bucket')))

 

 

when i try to submit this is just says expression is invalid.

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @kilaj1 ,

you must use equals(A, B) expression instead of = character.

if(equals(triggerOutputs()?['body/FeedbackType/Value'], 'Communications'),variables('Communications Bucket'),if(equals(triggerOutputs()?['body/FeedbackChannel/Value'], 'Programs'), variables('Programs Bucket'), '...'))


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

1 REPLY 1
tom_riha
Super User
Super User

Hello @kilaj1 ,

you must use equals(A, B) expression instead of = character.

if(equals(triggerOutputs()?['body/FeedbackType/Value'], 'Communications'),variables('Communications Bucket'),if(equals(triggerOutputs()?['body/FeedbackChannel/Value'], 'Programs'), variables('Programs Bucket'), '...'))


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,762)