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 / Update Field in ShareP...
Power Automate
Answered

Update Field in SharePoint List Based on Department

(0) ShareShare
ReportReport
Posted on by 4

Hello. I have a SharePoint list to track things assigned to different departments. When a user submits a request for approval of a new item a flow fires and has been working until we made an update to capture department. I want to get their department and then mark their department column with an X. We did it this way rather than have a department field because an item can apply to multiple departments and the users prefer the view by department rather than a multi-department single field. 

 

I've tried multiple variations of this formula. For example, if I choose this formula when I save the flow I get "The input parameter(s) of operation 'Create_item-1' contains an invalid expression(s). 

Formula: ifoutputs('Get_user_profile_(V2)')?['body/department']='SEO','X',ifoutputs('Get_user_profile_(V2)')?['body/department']='Earned Media','X',null
 
If I use this formula I get "The expression is invalid" when I try to update the formula. 
Formula:  if(outputs('Get_user_profile_(V2)')?['body/department']='SEO','X',if(outputs('Get_user_profile_(V2)')?['body/department']='Earned Media','X',null))
 
Can anyone help me understand what I am doing wrong here? 
Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,695 Super User 2025 Season 2 on at

    Hi @HowDoesThisWork ,

     

    In Power Automate you need to use the equals function in order to test for equality.

     

    I think your expression needs to be:

     

     if(
     or(
     equals(outputs('Get_user_profile_(V2)')?['body/department'], 'SEO'), 
     equals(outputs('Get_user_profile_(V2)')?['body/department'], 'Earned Media')
     ), 
     'X', 
     null
    )

     

    Entered all on one line:

     

    if(or(equals(outputs('Get_user_profile_(V2)')?['body/department'],'SEO'), equals(outputs('Get_user_profile_(V2)')?['body/department']='Earned Media')), 'X', null)

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • HowDoesThisWork Profile Picture
    4 on at

    That did it! Thanks so much for your assistance!

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard