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 / 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
    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
    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
    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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard