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 / Using if(contains) sta...
Power Automate
Unanswered

Using if(contains) statement in update item.

(0) ShareShare
ReportReport
Posted on by 80

Hello,

 

I am still learning this correct formatting and syntax for this system. I have a list with multiple columns and shown. I would like to add a Role column that updates based on the class that was selected. My current flow works for the function in the Totals for class, so it is likely how the If statement is written. I get an error message about the number of characters.

Any help is appreciated. Thank you.

list.jpg

flow update.jpgedited to add a better picture of If statement.

 

if statement.jpg

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @ML147243 ,

    the if(...) should be entered as an expression, not as a string.

  • ML147243 Profile Picture
    80 on at

    @tom_riha Hi Thanks,

    Yes, I have tried to enter it as an expression and I get that the expression is invalid. 

  • Verified answer
    tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    My guess would be that you're missing one or more closing brackets. Try to put the whole expression in some code editor, e.g. 'Visual Studio Code' to check if every opening bracket has also a closing bracket.

  • ML147243 Profile Picture
    80 on at

    So it was that I was using " instead of ' . The flow isn't working though, I tried changing class to class value but it still is not working. 

  • ML147243 Profile Picture
    80 on at

    after some tweaking, this was what worked,

     

    if(contains(triggerBody()?['Class/Value'],'EDM RN'),'RN',

    if(contains(triggerBody()?['Class/Value'],'Tech'),'CNA',

    if(contains(triggerBody()?['Class/Value'],'CNA'),'CNA',

    if(contains(triggerBody()?['Class/Value'],'HUC'),'HUC',

    if(contains(triggerBody()?['Class/Value'],'SIS RN'),'RN',

    if(contains(triggerBody()?['Class/Value'],'RN'),'RN',

    if(contains(triggerBody()?['Class/Value'],'HF'),'RN',

    if(contains(triggerBody()?['Class/Value'],'student'),'SN',

    if(contains(triggerBody()?['Class/Value'],'SCM RN'),'RN',

    If(contains(triggerBody()?['Class/Value'],'Athena'),'HFMG','other'))))))))))

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