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 / Read from Excel value ...
Power Automate
Answered

Read from Excel value doesn't exist

(0) ShareShare
ReportReport
Posted on by 72

Working on a Power Automated Desktop flow depending on the name read from a web page element I am looking up the name in Excel to determine what flow block it should go to. There are several hundred names but only a handful have specific requirements thus having different flow blocks and, in my Excel, I only included the names with unique flows. Problem that I have is for all the names that don't exist in Excel, PAD throws and error when it can't look up the value. I haven't been able to find a way to do the look up and if the value is found set a variable to the value in the mapped excel file else default to some other value. 

I know I can do this with multiple if / else conditions but to me it seemed easier to do a lookup to set the flow block. Any thoughts would be greatly appreciated. 

  • Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @lkhall_37203 

     

    I don't know how your flow is throwing an error if not found in the excel, but can you share screenshot of your workflow?

     

    Suggestion here is that you can use For Each once you use the Read Excel action, so you can loop and check if the excel value is equal to web element text. If you found then place a variable and set the value the break action inside the for each loop

     

    Now, Outside the for each loop you can put a condition that If the variable you placed is not a null then you can place switch action to run different blocks

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • lkhall_37203 Profile Picture
    72 on at

    Guess I should have been clearer, what I am doing is first running a find and replace action to find the row / column index in Excel of the variable. Then doing a read from Excel where I pass in the row index from the previous step to find the correct row value for my flow variable. The find / replace action fails if it doesn't find the value that I am trying to look up. I wanted to know if there is any way using the find / replace action if it doesn't find anything to default to a value. Now that I think about it, I think I can configure the on-error property in the find / replace and set the variable value there and let the flow continue. Unless anyone thinks there is a better way to handle this. 

  • Verified answer
    Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @lkhall_37203 

     

    I got your issue now, Yes, I believe the OnError setup is the best way to handle this issue, As it has to continue on error and set the value with some default values

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

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 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard