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 / Unable to add rows int...
Power Automate
Unanswered

Unable to add rows into table from dynamic file to another dynamic file

(0) ShareShare
ReportReport
Posted on by 30

Hi,

 

I have a case where I receiving an excel files (always the same format)  into a sharepoint folder and I want to extract the rows from table in the anther excel file which gets generated by using "formatDateTime(utcNow(),'yyyy-MM-dd') Report.xlsx" file. 

 

Source file name is dynamic, table "Inventory" is static.

Destination file is dynamic and table "Template" is static.


My flow:

ZsoltDaBeast_0-1682520604220.png

Ideally, I want to use the output of Get files into the Add into tables. In the Get files, I'm checking if the "formatDateTime(utcNow(),'yyyy-MM-dd') Report.xlsx" file exist. If yes than Add the rows into it.

ZsoltDaBeast_1-1682520682315.png

The problem is that in the "Add rows into table" function I cannot see a way to map the column names to destination table from the source table.
==================================================================================
It works if I assign the static file into it but this is not what I want.

ZsoltDaBeast_1-1682521341458.png


I have checked this case Adding rows into table from dynamic file, unable to map columns but this is using static destination file. 

Thanks for your help.

Categories:
I have the same question (0)
  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @ZsoltDaBeast ,

     

    Refer to my demo below:

    You can manually edit your record in a compose action.

    vwenjuanmsft_0-1682580083889.png

    Result:

    vwenjuanmsft_6-1682580243225.png

     

     

    Community Support Team _ Wenjuan Zou

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

     

  • ZsoltDaBeast Profile Picture
    30 on at

    Hi @v-wenjuan-msft 

    Ok, so I have modified my flow by using "Compose" for my Source File to get the Rows (In your case Compose). and to my Destination file. (In your case Compose_2).

    However, my destination file compose does not as it becomes an "Apply to Each" function if I add the "Identifier" or "value" or "body" or "file name with extension" of "Get Files (properties only)".

    The destination file is not a static file but the table is (Template). The file name changes everyday using formula: "formatDateTime(utcNow(),'yyyy-MM-dd') Report.xlsx" file ".

    RESULT:

    ZsoltDaBeast_1-1682587815008.png

    Action 'Add_a_row_into_a_table' failed. A value must be provided for item. clientRequestId:.....

    ZsoltDaBeast_2-1682587862029.png

     

    It sounds to me I need to GET the file path and use that value in the Compose_2 which would be than linked into "file" in the add row into table. 

    Any idea?

    Thanks

  • ZsoltDaBeast Profile Picture
    30 on at

    Hi,

    Is anyone out there can help in this, please?

  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @ZsoltDaBeast ,

     

    Sorry for not explain more clearly...

    Actually in my demo, content in Compose action is destination file path. Content in Compose 2 is body of the record I want to add into the Excel.

     

    I understand that your issue is if you add the file name by dynamic content rather than a static file name, columns will not list in action "Add a row into a table". There will be only a "Row" field display like this:

    vwenjuanmsft_0-1683107841726.png

     

    So in my Compose 2, I wrote the record manually like this:

     

    {"A":"1","B":"2"}

     

     

    Here is my excel structure:

    A is column name, 1 is the content I want to add.

    vwenjuanmsft_1-1683108018990.png

     

    Hope I made myself clear this time 🙂

     

    Community Support Team _ Wenjuan Zou

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

     

     

  • Verified answer
    ZsoltDaBeast Profile Picture
    30 on at

    Hi @v-wenjuan-msft,

    I done it but not with "Compose" as you suggested.

    I have figured it out by using "Initialize Variables" for Source file and table & Destination file and table and I have used these values in the "Create table", "List Rows present in a table" and "Add row into a table". I had a lack of knowledge about how the variables works but after a bit of studying I have found them useful in my case.

    By storing the value in variables made my life easier and the flow not get confused because sometimes it confuses itself and I had to build up from scratch. 

    In the value fields my expectation of files where the date changes on every day but the tables are statics. These name of values I used in my flow later down the line.

    ZsoltDaBeast_0-1683191067683.png

    ...than Create table" and "List Rows present in a table"

    File: /Folder name/ Sub folder/ Name of sourcefile variable
    Table: /Folder name/ Sub folder/ Name of sourcetable variable

    ZsoltDaBeast_1-1683191311562.png


    Once the Source file and table exist than copy the content rows into a different dynamic excel file.
    File: /Folder name/ Sub folder/ Name of destinationfile variable
    Table: /Folder name/ Sub folder/ Name of destiantiontable variable

    ZsoltDaBeast_3-1683191615358.png


    I hope this helps for others.
    Thanks for looking at 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

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard