web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Saving excel data from...
Power Automate
Unanswered

Saving excel data from an email (script not running)

(0) ShareShare
ReportReport
Posted on by 10

So I've been working on this flow for about a week now and I just keep hitting errors after errors, making the flow more and more bloated and I decided I better come here and just ask for some help.

 

The basic function of the flow is to take an excel file that I get emailed everyday and update an existing sheet with the new data.

 

Here is my flow with some explanation to my reasoning:

 

Firstly the flow triggers from an email to a specific folder in my outlook

RobCad_0-1652962994011.png

 

Next, I take the contents of the emailed excel file and update an existing file with the contents. The reason I use "Update file" is so I can run two scripts, 1 to remove all formatting from the file (it has filters, which won't allow me to create a table) and 1 to format the data into a table (since Power Automate only lets you interact with data in a table).

RobCad_1-1652963224443.png

 

Next I get the rows of a table in a separate excel file (this is the file I'm doing all the actual data manipulation in) and I delete all the existing data.

RobCad_2-1652963377459.png

 

Next I get the table that I created earlier.

RobCad_3-1652963439991.png

 

Finally I get the rows of the table with the new data in and I copy that data across into the other excel sheet.

 

 

Now the current error I get is that the flow won't run the scripts that I've built:

RobCad_4-1652963728324.png

 

 

So I suppose I'm asking for either:

  • A fix for the above error?

or

  • Is there any easier and more efficient way to build this flow all together?

 

Thanks.

Categories:
I have the same question (0)
  • Yutao Huang Profile Picture
    Microsoft Employee on at

    Oh I see. Sorry I misread your post. In that case, indeed there seems no straightforward way to use dynamic column names without Office Scripts... 😞

     

    I'd be more than happy to assist you in troubleshooting the issue if you want to give Office Scripts another shot later.

  • RobCad Profile Picture
    10 on at

    The custom values I need to enter are for the column names that I want to use to populate the "Add a row into a table" step:

    RobCad_0-1653987385619.png

    But because these columns are being taken from a table that was created earlier in the flow, they only exist as a "current item" dynamic content.

     

    As I'm writing this, it occurs to me that a possible work around could be creating a second flow that triggers off of the temp file table being created and could therefore perhaps treat the table values as static rather than dynamic. I will have to test this.

  • Yutao Huang Profile Picture
    Microsoft Employee on at

    @RobCad - if you want to specify a dynamic value for the table name, you'll need to first switch to use "Enter custom value", then enter the dynamic content returned from preceding steps.

     

    Yutao_0-1653931054439.png

     

     

  • RobCad Profile Picture
    10 on at

    Hi,

     

    The file size is around 300kb

    The data is literally just a spreadsheet of names and numbers

     

    I'm currently working out an alternative: I've talked with the person who does the data dump emails and got him to alter the spreadsheet's formatting so that I don't have to run the scripts, this seems to work but now I've got a new error:

     

    "Unable to process template language expressions for action 'Apply_to_each_3' at line '0' and column '0': 'The template language expression 'outputs('List_rows_present_in_a_table_2')?['body/value']' cannot be evaluated because property 'body/value' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'."

     

    It would seem that because the table columns of the table I'm trying to copy from are treated as dynamic, I can't tell power automate which columns I want to add data for when I carry out the "add a row in a table" step. I'm not exactly sure how I am supposed to get the dynamic names of the columns to use in this step, will have to do some looking.

     

    Thanks,

    Rob.

  • Yutao Huang Profile Picture
    Microsoft Employee on at

    No worries! Let's see if we can figure out what's causing the problem here.

     

    • Do you know the file size of this workbook?
    • What are the different types of data in the workbook? Charts, images, shapes, data connections, pivot tables, ActiveX controls, etc.?
    • Can you try using one attachment as an example?
      1. Firstly, as we mentioned above, upload the attachment to OneDrive for Business.
      2. Create a simple test flow with a manual trigger and a Run script action that runs your script against that uploaded workbook.
      3. Trigger the flow manually and see if it works.
      4. If it fails, try to simplify the workbook and trigger the flow again.
      5. Gradually narrow down the types of data contained in the workbook.
      6. If the script starts to work after removing a certain type of content from the workbook, that type of data could be the culprit.
  • RobCad Profile Picture
    10 on at

    Unfortunately I cannot share any data from this flow that I am working on

  • Yutao Huang Profile Picture
    Microsoft Employee on at

    Hmm... that is strange.

     

    If that workbook doesn't contain sensitive information and you don't mind, please feel free to send a private message to me and perhaps share the workbook so I can take a look?

  • RobCad Profile Picture
    10 on at

    Thanks for helping,

     

    1. It's an xlsx file

    2. Done

    3. It can be open online

     

    Cheers,

    Rob.

  • Yutao Huang Profile Picture
    Microsoft Employee on at

    Let's try some troubleshooting steps here:

     

    1. Save the attachment from one of the emails. Observe the file extension - is it .xlsx? or .xls? Or something else?
    2. Upload this file to your OneDrive for Business (or SharePoint, whichever you normally store your cloud files).
    3. Directly open this file from OneDrive for Business (or SharePoint). See if it can be successfully opened in Excel Online.

     

  • RobCad Profile Picture
    10 on at

    Hi,

     

    I've tried the flow using both xlsx and xlsm files as the "temporary data storage" file and either way I still get an "unable to run the script" error.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 185 Super User 2025 Season 2

Last 30 days Overall leaderboard