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

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 II
Super User II

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 II
Super User II

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,127)