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 two excel file...
Power Automate
Unanswered

compare two excel files in onedrive and send email notification when condition is met

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

First message here and somehow a newbie to power automate, thanks for your help in the following case:

I have two excel files, each with an "ID" column.

If excel file B does not contain an ID that is present in excel file A, I would like to highlight the ID in this excel file A in red colour and receive an email notification with this(these) ID(s) in the body of the email.

Please note that file A can repeat IDs in the same column.

I can't get this flow to work as it results in this error:

 

"The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each_3')?['ID']' is of type 'String'. The result must be a valid array."

 

Any ideas?

 

Regards,

 

 

 

Categories:
I have the same question (0)
  • rzaneti Profile Picture
    4,491 Super User 2026 Season 1 on at

    Hi @Helenag ,

     

    Some comments:

    • If the data in both files is organized as tables, you can perform the comparison task with Power Automate actions without any issues
    • However, Power Automate cannot directly change the formatting of an Excel range (highlight it in red). To achieve it you can either:
      • Use an Office Script, which is similar to a VBA, but compatible with Power Automate. It is TypeScript based, so it may require a basic knowledge about programming (check some articles about it at the end of this post)
      • Create an additional column in your Excel file just to control the ID presence from 'file B'. You can use only true/false or yes/no in this column, and then set a conditional formatting rule to highlight the cell if it is marked as 'false' or 'no'. Particularly, I believe that this option may be easier to implement for your use case.
    • About your error, you are apparently trying to loop the 'ID' value from one of your records. I know that these Power Automate loops can be tricky sometimes, so could you please share an image of your flow design to we investigate how does it look and where the error is?

     

    Recommended articles:

    http://digitalmill.net/2023/06/10/office-scripts-the-new-vba/ 

    http://digitalmill.net/2023/06/19/get-started-with-office-scripts/

    https://learn.microsoft.com/en-us/office/dev/scripts/overview/excel 

    https://github.com/OfficeDev/office-scripts-docs/blob/main/docs/develop/scripting-fundamentals.md 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 889

#2
Valantis Profile Picture

Valantis 830

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard