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 / Power Automate - Compa...
Power Automate
Suggested Answer

Power Automate - Compare Two SharePoint Lists and Update Values

(0) ShareShare
ReportReport
Posted on by 6
Hello everyone,
I’m working on a Flow in Power Automate to compare two SharePoint lists, List A and List B, based on a date column. If the dates match, I need to update the Guest Count in List B using data from List A.
 
Details:
  1. List A (Booking List):
    • Contains a column called Check-Out Date.
    • Also includes a column for the Guest Count.
  2. List B (Payroll List):
    • Contains a column called Work Date (corresponding to Check-Out Date in List A).
    • I want to update the Guest Count column in List B with the value from List A if the dates match.
  3. Current Flow Setup:
    • I have two Get Items actions to fetch data from both lists.
    • Two nested For Each loops iterate through the items in the lists.
    • A condition checks if the dates in Check-Out Date (List A) and Work Date (List B) match.
    • If a match is found, the corresponding item in List B is updated with the Guest Count from List A.

 
Unfortunately the Flow is not working as expected. I have tried  troubleshooting using a process of elimination, but I couldn’t identify the issue. It either gets stuck at the condition or returns 0 matches when comparing the  date columns. I even tested the setup by replacing the date values with simple numeric values (1, 2, 3, 4), as I thought the date format might not be compatible, but that didn’t work either.

Any tips or suggestions?
Categories:
I have the same question (0)
  • Suggested answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at
    Hi
     
    Follow the below steps please.
     
     
    Following steps all are under the Apply to Each loop
     
     
     
    Above expression is as follows:
     
    formatDateTime(outputs('Compose_2'),'yyyy-MM-dd')
     
     
    Above expression for the length() is as follows:
     
    length(outputs('Get_items_3')?['body/value'])
     
     
     
    Above expression for the add() is as follows:
     
    add(items('Apply_to_each_2')?['NumberOfGuests'],items('Apply_to_each')?['NumberOfGuests'])
     
    Here is my final result
     
  • CU04012341-0 Profile Picture
    6 on at

    Hello,

    First of all, thank you very much for your support. I am a beginner in this topic and truly appreciate your assistance. I triple-checked to make sure I entered everything correctly, but unfortunately, I am still getting this error message. However, the columns are numeric (so Integer should actually be correct, or am I mistaken?).

    I’ve attached a few images for reference. Please don’t be confused by the German labels; I deliberately translated them into English for the purpose of my question. Of course, I used the German version in the expressions.

    Error:



    Here some other Screenshots:

     

     


    Best regards,
    Gianluca

  • CU04012341-0 Profile Picture
    6 on at
    @abm abm

    I’m not sure if you receive notifications, so I’m making another post—sorry about that. Below is my question.
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at
    Hi
     
    We do have a time difference and I saw this notification now only.
     
    The reason for the error is add() expression you are adding contains a null value?  You have got two options here.
     
    1. Default to zero or something
    2. Check with an IF condition the value is null or not before you add the add expression.
     
    Thanks
  • CU04012341-0 Profile Picture
    6 on at

    Hi @abm abm
     

    Thank you for your reply. I just wrote again to make sure you received the notification – I didn’t mean to stress you out. :)

    I have double-checked, and there are numbers in each row. The add() function always has values, as it’s not possible for a null value to occur. There’s always at least one guest (and a maximum of four) for any booking. I have double-checked and there are number in each row

    Do you have any idea what else could be causing the issue?

    Best regards

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard