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 / Filling excel table's ...
Power Automate
Answered

Filling excel table's name in [List rows present in a table] action when the excel is dynamic

(0) ShareShare
ReportReport
Posted on by 106
Hi, everybody , Are there anyone can help me with the question below?
Question: I want to fill the name of a table in a excel file into 「list rows present in table」action's 「table」parameter. But I don't know how to write the expression
Backgroud: By using power auto, I want to copy a file from box(drive) to OneDrive. and finally I want to input the data in the file into a sharepoint list. When the file was copied into box, the name of it is dynamic which is depending on the time.  But the table name of all the file  is the same. Let's call it 「table1」.
About the parameter [list rows present in a table] , the capture is below.
Here is the expression in the parameter
「file」→ outputs('create file')?['body/path']   outputs('create file')?['body/name']      
What I did: I tried using「 get tables」 action to get the name of the table in the excel file. It failed. The errer is[Action 'Get_tables' failed: Graph API request failed. Error code is 'invalidRequest'. Error message is 'Invalid request'.]
Here is the expression in the parameter
「file」→outputs('create file')?['body/path']   outputs('create file')?['body/name']      
 
The whole flow and expression is in the bottom.



The capture of the hole flow is to big, so I seperated it into 3 parts. You can check it below.
And Sorry,  for the Japanese. I translated the action name to English below. You can compare the name below with the capture I post above. I put the Japanese translation just after actions' English names.
manually trigger →current time→conver a time zone→compose →get file content using ID(box)→create file (onedrive)→ time variable(変数を初期化する) →do until→get tables→for each→ list rows present in a table(表内に存在する行を一覧表示)→apply to each→get items(複数の項目の取得)→control  (条件)
  ∟ true → [create item](項目の作成)
  ∟ false  →for each → [update item](項目の更新)
→increment variable(変数の値を増やす)

list rows present in a table」can not get data from excel more than 256 rows, so I'm using [do until] to get data more than 256 rows.
 
The parameter in actions↓
manually trigger : the type of user input →number
current time: no expression in it.
conver a time zone: basetime→body('current_time')  source time zone→ (UTC)Coordinated Universal Time    Destination time zone→ (UTC+09:00)Osaka,Sapporo,Tokyo   Time unit→
formatDateTime(body('Current_time'), 'yyyyMMdd-HHmmss')
compose: inputs → workfile body('conver a time zone').xlsx
variable : name→count    type→integer   value→0
get file content using ID(box): File ID→  I choosed from the open folder button.  infer content type →Yes
create file(onedrive):file name→output('compose')  file content→body(’get file content using ID’)  Folder Path→ I choosed from the open folder button.
do until:  loop stop condition →  variable('count')  is equal to  triggerBody()?['number']
get tables:  Location→ OneDrive for business  Document Library→ document   File→outputs('create file')?['body/path']   outputs('create file')?['body/name']      
list rows present in a table(get the data from excel):   
File →outputs('create file')?['body/path']   outputs('create file')?['body/name']      
table→
outputs('Get_tables')?['body/value'][0]['name']
skip count → variable('count')   datetime format→ ISO 8601
apply to each :  outputs('list rows present in a table')?['body/value']
get items(get the data from sharepoint): filter query→title eq 'title' top count→1
control  : condition expression →empty(outputs('get items')?[''body/value']) is equal to true
   ∟ true → [create item]
   ∟ false →[update item]
 
increment variable:  name→count   value→1
 
 
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    UshaJyothiKasibhotla Profile Picture
    225 Moderator on at
     
    If you want to get the table name dynamically from an excel then use Get tables action and give the excel path and details in the action. from that action you can get the table names whatever present in the excel and the output of this get table name you can write into the excel using add row into the table. 
    Here I hope You have input file excel which has a table name you wanted to get the table name from the input file and you wanted to write it into destination excel.
     
    Please confirm.
     
    Hope this helps,
    Usha Jyothi
     
  • KS-29050310-0 Profile Picture
    106 on at
    @UshaJyothiKasibhotla Thank you. As what I wrote in the question, I tried, but it failed. Can you tell me how to make the expression or the flow right?
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at
    That Dynamic excel should have a predefined table. please check it has table and provide the screenshot so that I can check.
     
     
  • KS-29050310-0 Profile Picture
    106 on at
    @UshaJyothiKasibhotla Sorry for the Japanese, The name of the table is [table1], If you need some other information, please tell me.
     
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at
     
    Please check the get table name action and you are  getting table name or not and then destination file also should have predefined table to use the action add a row to table.
     
    Please check and let me know.
     
    Usha Jyothi.
  • KS-29050310-0 Profile Picture
    106 on at
    Thank you
    I thought I wrote the right expression in the [get tables] action, but when the flow came to get tables action, it failed. It means I couldn't get the table name in the excel which was created in onedrive. the error and the expression I have written in the question. And also you can check the expression, error and error capture below.
    get tables:  Location→ OneDrive for business  Document Library→ document   File→outputs('create file')?['body/path']   outputs('create file')?['body/name']      
     
    the error
    [Action 'Get_tables' failed: Graph API request failed. Error code is 'invalidRequest'. Error message is 'Invalid request'.]
     
    And what do you mean destination file? I guess you mean the sharepoint list? My destination file is sharepoint list, I am using create item and  update item to put the data in excel to sharepoint list. you can check the content in the question I wrote.
     
     
  • Verified answer
    Tomac Profile Picture
    4,061 Moderator on at
     
    Here's the problem: in your Get Tables action, you're using a bad path.
     
    The OneDrive action Create File uses output for Path that include the filename with extension, so you're adding the filename twice.
     
    Instead of:
    get tables:  Location→ OneDrive for business  Document Library→ document   File→outputs('create file')?['body/path']   outputs('create file')?['body/name']   
     
    Try this:
    get tables:  Location→ OneDrive for business  Document Library→ document   File→outputs('create file')?['body/path']
     
    If this resolves your issue, please mark it as the answer.
  • KS-29050310-0 Profile Picture
    106 on at
    @Tomac Oh my gosh, It works! Thank you very much!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard