Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Elarbe
Contributor II
Contributor II

Automation that includes looping and reading through a CSV file stops after 35 rows

Not sure if anyone else has been trying to do anything similar but basically I have a CSV file that is in Azure Blob storage and I'm using an automation to open and read the file before scrolling through each row. With a custom code block using python, the 7th and 8th columns of each row are being printed to create a new measure in an app (column 7 is the name of the measure and column 8 is the function and calculation).

It works fine until about the 35th or 36th row, where the custom code blocks seem to stop running for reasons I can't explain, which stops the information being extracted.

 

Elarbe_0-1679409553392.png

Before anyone says there is an automation template which works for creating measures from Excel files - I know, but I'm trying to do it from a CSV this way because there aren't the same permissions required.


Does anyone know if there is some kind of limit on automations or have any idea why this could happen?

 

Labels (4)
4 Replies
J_Lindberg
Support
Support

Hello @Elarbe,

Could you share some more details on how this automation is set up? 

Have you specified amount of items per batch in the "Loop Batch" block, or are you using the default? Also, do you run the custom code inside or outside of the loop? 

Elarbe
Contributor II
Contributor II
Author

Hi @J_Lindberg,

I have specified 14 items per batch (there are 14 columns which are being used as the headers) so I would have expected the loop to continue further than row 35 considering there are roughly 1000 rows, but for some reason stops at what seems like quite an arbitrary number.

The custom code blocks are inside the loop:

Elarbe_0-1679475875989.png

Thanks.

 

J_Lindberg
Support
Support

@Elarbe What if you store the header values in a list variable and then fetch the measure using index in a loop? I'm attaching an example automation with mock data.

Elarbe
Contributor II
Contributor II
Author

@J_Lindberg 

Thank you for taking the time to make the automation.

I imported it and it looks promising, but I haven't been able to get it to work how I needed it to. 

I think my issue has been fixed by trying something else but I will continue to see if I can get your automation with the mock-up data to work and let you know if this would also have been suitable.