cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LeandroCampacci
Frequent Visitor

Expression to collect Forms selection and defines correctly Planner label

Hi everyone,

 

I have a Power Automate proccess that collects responses of MS Forms and creates a card on MS Planner.

 

Now I want to define a correctly label on a new card based on a selection of a particular question on the form.

 

For example:  if in a given question the user selects options A and B I need a card with a pink label to be created.

If the user selects options D and E, the label will be green.

 

I tried to creat expressions like "if contais" with combinations constructed with variables, but every test fails.

 

LeandroCampacci_0-1664379985941.png

 

If(contains(variables('var4'),outputs[my_forms],True,False)

LeandroCampacci_0-1664380478951.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
LeandroCampacci
Frequent Visitor

Yeah, now it works.

 

I used string variable to collect forms response just to make it more easy. I believe that compose action makes it works too.

LeandroCampacci_0-1664463449726.png

 

On creat a task, I used only contains()

LeandroCampacci_1-1664463554168.png

 

contains(variables('Opcoes'),'Campus')


If necessary to use more contains on same expression, just add Or expression:


or(contains(variables('Opcoes'),'Backoffice'),contains(variables('Opcoes'),'CRA'))

View solution in original post

3 REPLIES 3
v-jefferni
Community Support
Community Support

Hi @LeandroCampacci ,

 

Please use array variable instead. The expression should be like:

If(contains(variables('var4'),outputs('Get_response_details')?['body/question']),true,false)

 

Best regards, 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-jefferni 

 

Thanks. "False" condition still persists. My variable construction is correct?

LeandroCampacci_1-1664454701899.png

 

In Forms output, I selected all options:

 

LeandroCampacci_2-1664454799440.png

 

LeandroCampacci_3-1664454995663.png

 

 




LeandroCampacci
Frequent Visitor

Yeah, now it works.

 

I used string variable to collect forms response just to make it more easy. I believe that compose action makes it works too.

LeandroCampacci_0-1664463449726.png

 

On creat a task, I used only contains()

LeandroCampacci_1-1664463554168.png

 

contains(variables('Opcoes'),'Campus')


If necessary to use more contains on same expression, just add Or expression:


or(contains(variables('Opcoes'),'Backoffice'),contains(variables('Opcoes'),'CRA'))

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,729)