Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Comparing and writing to a dynamic excel file

(0) ShareShare
ReportReport
Posted on by 22

Hi to all!

 

I new to PA and is trying to work out the below flow but was stuck at step 4. Would like to seek advice how do I proceed further, thank you!

 

1. New excel file uploaded to sharepoint (Table format with headers: ID, Description, Unit price). The excel filename is dynamic, but the table format is the same as below. 

 

Daniel2023_1-1689238100663.png

 

2. PA will trigger to read the new file

 

3. Data from the new file is extracted

 

4. To compare the new file data to a database excel file (common header - ID, Unit price)

a) There is no dynamic content available (headers of the new file) when i tried to use "condition". 

 

*This is unlike when i have PA to look into a known excel file name.

 

5. If ID is found in the database, PA will extract the value of the Unit price and write into the new file.

 

 

 

Daniel2023_0-1689237405263.png

 

=(

  • Daniel2023 Profile Picture
    22 on at
    Re: Comparing and writing to a dynamic excel file

    Thanks @v-wenjuan-msft !

  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Comparing and writing to a dynamic excel file

    You can not find expect column in drop downs as your file name is dynamic. So if the table name and key column are static, you can type them in as custom values directly.

     

    Community Support Team _ Wenjuan Zou

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

  • Daniel2023 Profile Picture
    22 on at
    Re: Comparing and writing to a dynamic excel file

    Hi @v-wenjuan-msft ,

     

    Correct, i am unable to find the expected drop down columns. I assume I have to enter "Table1" since it is a dynamic file. When it comes to Key Value, I am stuck as well.

     

    I have the below screenshot to illustrate what I am trying to do. 

    1. Below is the dynamic file which will be uploaded to sharepoint by my colleagues (different file names but same table format e.g. salesA.xls)

    2. Use PA to cross check salesA.xls with a database xls which is stored in sharepoint

    3. Product ID - BB and CC are found in the database xls. 

    4. Use PA to update the "Unit Price" column in salesA.xls

     

    Daniel2023_0-1689320127549.png

     

    Thanks again for your help!

  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Comparing and writing to a dynamic excel file

    Hi @Daniel2023 ,

     

    What do you mean unable to update here?

    vwenjuanmsft_0-1689319268478.png

     

    Does it mean you cannot find expected column in "Key Column" drop down?

    Or you mean you have run the flow but no modifications happened actually? If so, is there any error message shows up?

     

    Community Support Team _ Wenjuan Zou

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

  • Daniel2023 Profile Picture
    22 on at
    Re: Comparing and writing to a dynamic excel file

    Hi @v-wenjuan-msft ,

     

    Unfortunately i was not able to compare the values. It seems like I am not applying the right flow to do the comparison?

     

    Daniel2023_0-1689306812887.png

     

  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Comparing and writing to a dynamic excel file

    Sounds great to finish your task~

    Does the flow run well now with the function? If yes, would you please mark my answer to resolve the post? Thank you~

     

    Community Support Team _ Wenjuan Zou

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

  • Daniel2023 Profile Picture
    22 on at
    Re: Comparing and writing to a dynamic excel file

    Hi @v-wenjuan-msft ,

     

    Yes, your understanding is correct.

     

    The intention is that I am taking the data from the new file (dynamic) and compare to another excel file (static database). If the data can be found in the database, I will want to pull out the relevant info from database and append into the new file.

  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Comparing and writing to a dynamic excel file

    Hi @Daniel2023 ,

     

    You need to insert function like this:

    vwenjuanmsft_0-1689300327656.png

     

    So according to your logic, "value" you insert into "Apply to each" is from new file and "value" you insert into "Apply to each 2" is from database right?

     

    Community Support Team _ Wenjuan Zou

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

  • Daniel2023 Profile Picture
    22 on at
    Re: Comparing and writing to a dynamic excel file

    Hi @v-wenjuan-msft ,

     

    Yes i am able to retrieve the dynamic columns. 

     

    I am now doing the comparison but when it comes to the condition (where the productID from new file can be found in the database file), I am unable to update the row in the new file.

     

    Am i wrong with my flows? Thanks again for the help.

     

    Daniel2023_2-1689244239282.png

     

     

     

  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Comparing and writing to a dynamic excel file

    Hi @Daniel2023 ,

     

    Test to run your flow and check outputs of "List rows present in a table", to see whether it retrieved your dynamic columns or not.

    vwenjuanmsft_1-1689241391360.png

     

    If yes, you can call values from them with function:

     

     

    items('Apply_to_each')?['changetoyourcolumnname']

     

     

    vwenjuanmsft_0-1689241263348.png

     

    Notice:

    Power Automate cannot find your columns if they have blank space in column name. Remember to cancel it.

     

    Community Support Team _ Wenjuan Zou

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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow