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 / Struggling to Match Ge...
Power Automate
Suggested Answer

Struggling to Match Get Rows from Excel to Get Items in SharePoint on Common Value

(2) ShareShare
ReportReport
Posted on by 111
Hello - I've written flows like this a million times, but I'm failing today and don't know way.

I have a list of SharePoint items with a column called Ref (it is single line text.)
I have an Excel Spreadsheet in OneDrive with a column called Ref # (Booking) (Booking).  It is numeric (no commas or decimals), (And no, I can't change it, much as I would love to.)

I want all SharePoint items with column Start Date on or after today.
 
I want all Excel items where Ref # (Booking) (Booking) is the same as Ref from SharePoint AND Excel column Itinerary Link is not null/blank/empty. (It is text).

I continue to fail to find a match between the two, though I know they are there.







Categories:
I have the same question (0)
  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
     
     

    Looking at your screenshots, the mismatch is almost certainly a type/format issue between the two Ref values.

    Excel numeric columns often come through the connector as "123.0" even when the cell shows "123", and your SharePoint Ref is plain text. So even with trim() and string() wrapping, you end up comparing "42" against "42.0" and it never matches.

    The fix is to normalise both sides to integer-as-string before comparing. In your Current SP Ref compose, use:

     

    string(int(trim(string(items('Apply_to_each')?['Ref']))))

     

    And in Filter array 1, make the left side:

     

    string(int(item()?['Ref x0023 (Booking) (Booking)']))

     

    The x0023 encoding is correct and not your problem, that is just how Power Automate handles the # symbol internally.

     

    For the Itinerary Link blank check, switch Filter array 1 to advanced mode and do both conditions together:

     

    @and(equals(string(int(item()?['Ref x0023 (Booking) (Booking)'])), outputs('Current_SP_Ref')), not(empty(string(item()?['Itinerary Link']))))

    One more thing worth checking. Your first Filter array (before Apply to each) has toLower on the Itinerary Link but I cannot see what it is being compared to. If that condition is incomplete or comparing against empty string, it may be wiping out all your Excel rows before you even get into the loop.

    Before anything else, drop a Compose right after List rows present in a table and output the first item body. Check the actual value coming through for Ref # (Booking) (Booking). Nine times out of ten you will see the decimal there and that confirms the int() fix will solve it.


     
  • amulhearn0207 Profile Picture
    111 on at
    @Vish WR thank you so much for the timely and helpful reply. I'm still missing something, and I'm sure it is my own misunderstanding. I've tried to follow your recommendations and am now receiving this error.

    Flow run failed. Action 'Filter_array_1' failed: The execution of template action 'Filter_array_1' failed: The evaluation of 'query' action 'where' expression '@equals(string(int(item()?['Ref x0023 (Booking) (Booking)'])),outputs('Current_SP_Ref'))' failed: 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

     




  • Vish WR Profile Picture
    3,748 on at
     

    The error is because int() can't handle decimals. Change the left side of Filter array 1 to:

    string(int(float(item()?['Ref _x0023_ (Booking) (Booking)'])))

    That handles "42.0" coming from Excel. Your Current SP Ref compose stays as is.

    If that still fails, the value has something unexpected in it. Put a Compose after List rows present in a table pointing at first(body('List_rows_present_in_a_table')?['value']) and check what actually comes through in the run history.


     
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hi @amulhearn0207,
     
     
    The possible reasons for this error, if the value  is mmight be: Null or empty, contains non-numeric characters or a string that cannot be parsed as interger. In this case coalesce() is our frined. Please check coalesce(item()?['Ref xoo23 (Booking) (Booking)'], '0') based on this you can decided which converstion is needed.
     
     
    Also, please validate the field name, "Ref x0023 (Booking) (Booking)" is the correcct internal name and that contins the expected data/value.
     
     
    Side note: In case if you didn't forget to formate excel table: To process Excel data in Power Automate, the data must be formatted as an Excel Table. How.
     
    Reference:
    Power Automate always needs a table
     
     
     
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    The int() error happens because Excel numeric columns come through as decimal strings like "42.0", and int() can't parse those directly. The fix is to go through
    float() first:
    For the Filter array left side:
    string(int(float(item()?['Ref _x0023_ (Booking) (Booking)'])))
    For your Current SP Ref compose:
    string(int(float(string(items('Apply_to_each')?['Ref']))))
    Note the correct internal name uses underscores around x0023: Ref _x0023_ (Booking) (Booking) not Ref x0023 (Booking) (Booking). This may be causing the field to return null, which is why int() fails with an invalid value error.
     
    To verify both values before the filter:
    1. Add Compose 1 after List rows: first(body('List_rows_present_in_a_table')?['value'])?['Ref _x0023_ (Booking) (Booking)']
    2. Add Compose 2 in your Apply to each loop: items('Apply_to_each')?['Ref']
     
    Check the run history outputs of both composes. If Compose 1 returns null, the field name is wrong. If it returns '42.0', the float() fix will work. If it returns '42', you can use int() directly without float().
     
    The Itinerary Link blank check alongside the Ref match in advanced filter mode:
    @and(equals(string(int(float(item()?['Ref _x0023_ (Booking) (Booking)']))), outputs('Current_SP_Ref')), not(empty(string(coalesce(item()?['Itinerary Link'],'')))))
     
      Best regards,

    Valantis   ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard