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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard