Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Where to begin - extract Excel data

(0) ShareShare
ReportReport
Posted on by 70

Hi, I have an Excel spreadsheet with an active connector to a source data file which has many columns. This xlsx is the filtered to exclude certain rows. I need to extract 5 specific columns from that sheet, and export it to another csv file overwriting the original csv. (I hope that makes sense).

 

I'm not sure where to begin with this one. It seems that in order for the data connection to update the xlsx file would need to be opened so the data can be refreshed. Once that problem is solved, I can't find any hints on how to copy out those specific rows as csv data and overwrite without a prompt.

 

I would love to hear your ideas.

 

Thanks and regards

Andrew

  • v-duann-msft Profile Picture
    on at
    Re: Where to begin - extract Excel data

    Hi @AK-47 

     

    Thanks for reply. Good to hear it works for you.

     

    To overwrite the former file, we need to use 'update file' action instead of others. If you use 'create file', it will get duplicate error definitely.

    v-duann-msft_0-1616139635682.png

    Best regards,

    Anna

  • AK-47 Profile Picture
    70 on at
    Re: Where to begin - extract Excel data

    That seems to have fixed the condition trigger thanks. The last failure now is that it can't overwrite the existing file.

     

    AK-47_0-1616061103753.png

     

  • v-duann-msft Profile Picture
    on at
    Re: Where to begin - extract Excel data

    Hi @AK-47 

     

    Thanks for your attempts.

     

    I tested and found the issue is caused by encoding.

     

    If we use 'x-ms-file-name-encoded' as file name, the output of filename will be encoded as 'ZGFpbHlyZXBvcnQyMDIxLTAyLTI1MzMueGxzeA=='. Thus, we need it to decoded the file name as below:

     

    base64ToString(triggerOutputs()?['headers/x-ms-file-name-encoded'])

    v-duann-msft_2-1616055639695.png

     

    After that, you will be able to filter file based on normal name.

    v-duann-msft_3-1616055639698.png

     

    Hope it helps.

     

    Thanks

    Anna

  • AK-47 Profile Picture
    70 on at
    Re: Where to begin - extract Excel data

    Changed it to contains and confirmed site, collection, and filename are all correct but still the same result. 

  • v-duann-msft Profile Picture
    on at
    Re: Where to begin - extract Excel data

    Hi @AK-47 

     

    Please help to change condition to 'contains' and pay attention to capital words of the file name. It's case-sensitive.

     

    Thanks

    Anna

  • AK-47 Profile Picture
    70 on at
    Re: Where to begin - extract Excel data

    Thanks. The only issue is that it isn't seeing the file update. Unsure why.

     

    AK-47_1-1616054026210.png

     

     

  • v-duann-msft Profile Picture
    on at
    Re: Where to begin - extract Excel data

    Hi @AK-47 

     

    Thank you for update.

     

    If only warning pops up, it depends and should be no problem. Please feel free to test and if any issue, you can reply me again.

     

    Please click Accept as Solution if my post is helpful to you. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

     

    Best regards,

    Anna

  • AK-47 Profile Picture
    70 on at
    Re: Where to begin - extract Excel data

    I'm taking this approach for the trigger as this file is part of another flow which get's dropped into the library from an email attachment and is the source file of the Excel data connection. Automate is warning me that this "may" create an infinite loop. But I think with the condition to check the file name it should be ok. 

     

    Your thoughts?

     

    flow-trigger.jpg

     

  • chrissahagun Profile Picture
    197 on at
    Re: Where to begin - extract Excel data

    In my mind, it plays out like that 😁 but to be honest, I haven't tried this yet.

  • AK-47 Profile Picture
    70 on at
    Re: Where to begin - extract Excel data

    This looks pretty close. Since the data being extracted comes from an external data connection would this approach update the file data before extraction?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1