web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / variable Expression he...
Power Automate
Unanswered

variable Expression help please

(0) ShareShare
ReportReport
Posted on by 167

Using a SharePoint list with a multichoice field, a user can select 1-11 teams. In my flow, I added an initialize variable (varAssignedTo) and set it to a string. Next, I added an Apply to each containing an Append to String Variable. This is working great. 

 

Now I want to add an UPDATE ITEM action to update additional text fields used to indicate which teams have been assigned.

TeamA 

TeamB  

TeamC  

TeamD 

  

Using an UPDATE ITEM action, I want to select my TEAMB field, add an expression to look at my "varAssignedTo" and if it finds TEAMB in the string, set this field to YES

 

I see in the expression builder there is an "if(expression, valueIfTrue, valueIfFalse)"  however, being a rookie not sure how to write it out. something like, If(contains(variables('varAssignedTo'),'TeamB',YES,'')))

Categories:
I have the same question (0)
  • Diksha Profile Picture
    301 on at

    Hello @Portland ,

     

    Can you please share the screenshot of the flow you have developed ? 

    I want to see the value of variable varAssignedTo .

     

    Thanks,

    Diksha

     

  • Portland Profile Picture
    167 on at

    Portland_0-1602420257873.pngPortland_1-1602420280909.png

    This is the field to place the expression. If contains BUS set BUS EXP to YES

    Portland_2-1602420322147.png

     

     

  • Verified answer
    Portland Profile Picture
    167 on at

    I got it. 

    This expression works nicely. : 

    if(contains(variables ('varAssignedTo'), 'Bus'), 'Yes','')
  • Diksha Profile Picture
    301 on at

    Hi  @Portland ,

     

    Thanks for sharing the flow details.

     

    In an Update Item action , use below expression for BUS Exp field - 

    if(contains(variables('varAssignedTo'),'BUS'),'Yes','No')

     It will check if the variable varAssignedTo value contains a word 'BUS' and then set the value to Yes/No accordingly.


    Capture.PNG

     

    Output (List item)-

    output.PNG
    If this answered your question, please mark this question as answered and if you liked my response, please consider giving it a thumbs up .
    Thank You !!!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard