Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

PowerAutomate Get Tables Usage

(0) ShareShare
ReportReport
Posted on by 88

Hi,

I have a file that is recreated each night.

The file does not contain a table so I have used the create table in PA to create a table (table1) which works OK.

I am using Powerautomate to import the spreadsheet which when run manually works.

However, when scheduling, because the table is recreated each time, the flow fails and a hex string is in the import table name because the uid is different each time the tabel is createdl.

I think I need to use get tables function in PA to get the table ID and then pass it to the create sharepoint list step but the problem is, unless select the dropdown from the previous step, I am unable to map the fields from the excel spreadsheet to the sharepoint list.

Could anyone possibly help on how I can acheive this?

Thanks,

Categories:
  • MikeWJS Profile Picture
    88 on at
    Re: PowerAutomate Get Tables Usage

    Thanks for that, could come in handy!

  • antc Profile Picture
    34 on at
    Re: PowerAutomate Get Tables Usage

    For anyone looking for a solution where new files are uploaded just with 1 table just use Get Table first and use first() to pass to List rows action.

     

    antc2_0-1697416489070.png

     

  • MikeWJS Profile Picture
    88 on at
    Re: PowerAutomate Get Tables Usage

    Hi,

     

    Just thought I would chip in how I eventually got this all working.

     

    Here is the flow,

     

    Power Automate.png

    While this situation may be different to yours (my file comes from OneDrive) you may be able to adapt it?

    Basically, a script is run in Excel online which passes the information to the flow.

    The script is,

    function main(workbook: ExcelScript.Workbook,
     SheetName: string = "Report 1"
    ) {
    
    
     const selectedSheet = workbook.getWorksheet(SheetName);
     let data = selectedSheet.getUsedRange().getValues()
     console.log(data)
     return (data)
    }

     

    Note my data is in a sheet called Report 1.

     

    Then this is used to populate a Sharepoint list in my case (again, just use the fields in the body of the email etc., adapting as necessary) using this for the items,

    items('Apply_to_each')?[0]
    items('Apply_to_each')?[1]
    items('Apply_to_each')?[2] etc. etc. 
     
    Mine then matches the fields to the corresponding Sharepoint list fields.
     
    Hope this may help you get there....
  • abhilsbishal10_ Profile Picture
    2 on at
    Re: PowerAutomate Get Tables Usage

    Hi @rubin_boer , I having the same problem and did everything but couldn't find what's causing the problem. I have a excel file text.xlsx in share point which get replace every day with the same column, table name everything same but with fresh data. Now every time that file gets replaced I want to attach the excel table content in the body of the email. 
    If I use, List rows present in a table, I get 404 table not found error. And if I use List rows present in a table it gives me 404 table not found errorlist.PNG

    And if I use Get tables and list rows like @MikeWJS I cannot find the column name in select action to attach table in Send email action. I have tried every solution I can find so can you please help with this.
    Thanks

  • MikeWJS Profile Picture
    88 on at
    Re: PowerAutomate Get Tables Usage

    Thanks for your help,

    I eventually got it working using the items ('Apply_to_each') [Column name']

    It looks like this for informations sake.

    flow.png

    Although the flow works fine, it errors out.

    This is because the number of rows in the spreadsheet is unknown. I therefore have to set the table to be created for 5000 rows but after the actual data is imported, it creates lots of blank entries so expects a number instead of a blank record. How can I possibly suppress this error please?

    Once again, thanks for your help. I may mark this question as answered and open another question for the error above.

  • MikeWJS Profile Picture
    88 on at
    Re: PowerAutomate Get Tables Usage

    @rubin_boer 

    Thanks so much for your reply and help. I am currently on annual leave but will attempt this when I return and let you know how I get on!

    Once again, many thanks!

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at
    Re: PowerAutomate Get Tables Usage

    hi @MikeWJS my apology o thought the issue was the table 🙂

     

    To update SharePoint ad the following steps to the above:

    • Control: Apply to each
      • the value output from List rows present in table goes here
    • SharePoint: Create Item
      • the columns will not be listed in dynamic content, you need to add an expression for your tables
    • item()?['Title']
    • item()?['uid']
    • item()?['value']

    make sure your table names match your table in Excel

     

    rubin_boer_0-1646770470284.png

     

    There you go.

    Result

    Peek 2022-03-08 22-19.gif

     

    Hope it helps,

    R

  • MikeWJS Profile Picture
    88 on at
    Re: PowerAutomate Get Tables Usage

    Thank you sooo much @rubin_boer for taking the time to respond, you are very kind. A reply after trying to get this working after 8 hours has certainly made my day! Any feedback is welcome.. The part I am struggling with is the next step of creating the items in sharepoint, if you are kind enough could you possibly show me how that part would work?

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at
    Re: PowerAutomate Get Tables Usage

    hi @MikeWJS you on the right track. when you create the table the output of that step will give you the name of the table, which you then use to get the data to update SharePoint.

     

    Flow

    rubin_boer_1-1646767030259.png

    Result

    Peek 2022-03-08 21-23.gif

    Hope it Helps,

    R


     

     

  • MikeWJS Profile Picture
    88 on at
    Re: PowerAutomate Get Tables Usage

    To clarify - if I try to use "Table1" the flow fails as it is looking for the hex value.

    If I try to use a dynamic field I cannot map the fields as per this screenshot

     

    flow.png

    If anyone could help me out I would be extremely appreciative. I have spent 6 hours today trying to find a solution and have been pushed to the brink of insanity 😄

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,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard