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 / Compare value between ...
Power Automate
Answered

Compare value between 2 Sharepoint List and Update value in First Sharepoint List

(0) ShareShare
ReportReport
Posted on by 96

Hello All,

 

I am new to Power Automate but still want to know if this is possible?

 

I have 2 Sharepoint List  - Onboarding List , Offboarding List having Employee ID as common column. What I need is that to take employee ID from Onboarding List and check that value in Offboarding List . If that ID is present in Offboarding List  , then update the "Employee Status" column in Onboarding list as "Inactive" and if value is not present in Offboarding List, then update the "Employee Status" column as "Active".

 

Can you please help me with this. I could not get anything regarding comparing directly 2 SP List , so wanted to check if this can be done through Power Automate. If yes, can you please help with the flow/code .

 

Thanks and Regards,

Prateek9

 

Categories:
  • Verified answer
    v-peijunz-msft Profile Picture
    Microsoft Employee on at

    Hi @Prateek9 

     

    Based on your description, I have made a simple test for your reference.

    Here is the flow:

    ID eq '@{items('Apply_to_each')?['ID']}'
    length(outputs('Get_items_2')?['body/value'])

    vpeijunzmsft_2-1685350271870.png

    vpeijunzmsft_1-1685350172870.png

    If yes, update the "Employee Status" column in Onboarding list as "Inactive" in Update item, if no, update the "Employee Status" column in Onboarding list as "Active" in Update item 2.

     

    Best regards,

    Sylvia

  • Prateek9 Profile Picture
    96 on at

    Hello @v-peijunz-msft 

     

    Can you please tell me where this query is entered - ID eq '@{items('Apply_to_each')?['ID']} as i couldn't understand the Filter Query in Get Item 2 which had only ->  ID eq 'ID(sharepoint)' .

    Can you also please clarify whether the "Condition " is a new Step or is it a step inside the "Apply for each" after Get Items 2.

    Apologies , it might be simple for you but it's totally new for me and a bit confusing .

     

    Thanks and Regards,

    Prateek9

  • Prateek9 Profile Picture
    96 on at

    Hi @v-peijunz-msft 

     

    Somehow , i made flow run successfully but what happened was, for every Employee ID present in Onboarding List , Employee Status was set as "Active" even when some of the Employee ID on Onboarding Lsit were present in Offboading List . Not Sure what happened here . Below is the screenshot of my flow, can you please take a look:
    i have applied the below filter query in Get Item2 - Title eq 'items(Apply_to_each)?['Title']'

    Filter in Condition : - length(outputs('Get_items_2')?['body/value'])

    & i have kept the condition Step inside the "Apply for each" step (not sure if that was correct or wrong)

     

    Prateek9_0-1685365155732.pngPrateek9_1-1685365192075.png

    Prateek9_2-1685365230951.png

     

     

    Thanks and Regards,

    Prateek9

     

     

  • v-peijunz-msft Profile Picture
    Microsoft Employee on at

    Hi @Prateek9 

     

    In Get items Filter Query, you should make Employee ID in Onboarding List equals to Employee ID in Offboarding List.

    So the formula should be like:

    EmployeeID eq 'items('Apply_to_each')?['EmployeeID']'

    If you have the common column of Title then using Title should be good. However, as far as I understand, you use the employee ID as the common column.

    For your second question, yes, the Condition is an action that needs to be added in the Apply to each after Get items 2.

     

    Best regards,

    Sylvia

     

  • Prateek9 Profile Picture
    96 on at

    Hi @v-peijunz-msft 

     

    It's working with Title itself now . Actually , the Employee ID column in sharepoint list was originially named as Title , that's why even in Filter Query it was coming as Title . But , it's working now 

    Thanks Sylvia for all the help 😊

    Prateek9_0-1685429673454.png

     

    I need just one last help. Right now the flow does not run unless i run it manually (also because it was kept as manual trigger the flow. Is there a way where i can schedule this flow run where this flow will run at a specific time to update the Employee Status by comparing 2 SP List ?

    Prateek9_1-1685429759964.png

     

  • v-peijunz-msft Profile Picture
    Microsoft Employee on at

    Hi @Prateek9 

     

    You could use the scheduled flow with trigger "Recurrence". You could set frequency to trigger the flow based on your preference:

    vpeijunzmsft_0-1685430275736.png

     

    Best regards,

    Sylvia

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

  • Prateek9 Profile Picture
    96 on at

    Got it , thanks 😊

     

    I grateful to you taking out the time the to help me.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 445

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 300

Last 30 days Overall leaderboard