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 / Troubleshooting Help- ...
Power Automate
Unanswered

Troubleshooting Help- Array Index is outside bounds

(0) ShareShare
ReportReport
Posted on by 93

I'm trying to create a Flow that will automatically reformat a CSV into a proper tabular format. 

I received some great help on my original post to build the flow, here: https://powerusers.microsoft.com/t5/Building-Flows/How-do-I-format-CSV-to-proper-format-to-be-uploaded-into/m-p/2452262#M274015

 

However, I cannot figure out why I'm receiving this error:

"The execution of template action 'Create_CSV_table' failed. The column values could not be evaluated: 'The template language expression 'body('Select')[1][concat('col', item())]' cannot be evaluated because array index '1' is outside bounds (0, 0) of array. "

 

I've attached a Word doc with screen shots of everything. 

 

I've deleted the Flow and created a new one hoping that would fix the issue, but no luck.

I'm not too familiar with Flow so my troubleshooting is limited.

Any help is appreciated.

 

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

    Hi , @ljkeefe 

    According to your word , your error code is this:

    vyueyunmsft_0-1700534640946.png

    So the Select action return an array just with one row in your side , like this:

    vyueyunmsft_1-1700534679752.png

    So the issue is in your create html table action, you use this in it :

    vyueyunmsft_2-1700534731981.png

    Since the length of the array returned by your Select is only one, you can only use [0] to get the value, and any more than 0 will result in an error.
    For example, for an array [1,2,3], our maximum value can only be [2].

    So , you can just modify all the [n] to this @body('Select')[0][concat('col',item())] 

     

    Best Regards,

    Yueyun Zhang

     

  • ljkeefe Profile Picture
    93 on at

    @v-yueyun-msft Thank you for your response. I tried it and no longer receive an error, however, my data is not formatting correctly.

    It looks like this:

    ljkeefe_0-1700582765676.png

    Instead of this: 

    ljkeefe_1-1700582805690.png

     

     

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi, @ljkeefe 

    This may cause the wrong value to set in your "Create csv file" action.

    Because according to your error message, your Slelect action returns an array of length 1.
    So I asked you to change it to [0]. But I can't see the output in your Select here, so there's no way to help you get the value right.

     

    You can check in the run history of your flow if the value returned by your Select action is your intended input, and if it contains all the data you want to generate a csv file.
    If it doesn't, then you need to check if there is a problem with the return from the steps above.


    If the returned data is correct, you need to take the correct value based on the returned data.

    You can also paste in the output value of your run history to me, so that I can help you better!

    vyueyunmsft_0-1700620002738.png

     

     

     

    Best Regards,

    Yueyun Zhang

     

  • ljkeefe Profile Picture
    93 on at

    @v-yueyun-msft 

     

    Thank you..here's the output history. The data does not look correct in any of the steps. However, the column headers are the only item that do show correctly. I hope you can help. Thanks!

     

     

    ljkeefe_0-1700680256351.png

     

    ljkeefe_1-1700680256358.png

     

    ljkeefe_2-1700680256361.png

     

    ljkeefe_3-1700680256370.png

     

    ljkeefe_4-1700680256376.png

     

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @ljkeefe 

    Oh.. Why dose your csv file content return are Garbled?

    vyueyunmsft_0-1700710577979.png

    Is your Csv file encoded in UTF-8?
    Can you create a simple csv file test to see if the messy characters are caused by the csv file?

     

    Best Regards,

    Yueyun Zhang

     

  • ljkeefe Profile Picture
    93 on at

    @v-yueyun-msft I don't know why it comes out that way. It should just be a simple CSV that is created by 'Create CSV table' command. However, the Excel file that is retrieved at the beginning is .xlsx and is saved on a SharePoint site, could that be an issue?

  • ljkeefe Profile Picture
    93 on at

    @v-yueyun-msft Hi - just following with you to see if you had any other input. THanks!

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard