cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gabie
New Member

Start index error - substring

Hi, I have some problem with my flows. Everything was working since a few months and yesterday I have received error message: The 'start index' for function 'substring' must be equal to or greater than zero and must be less than '0' which is the length of the string..

However I didn't change anything. I can also see that sometime I have a success but its 1 success and 10 errors (or more). When I performed the test, there was also error. Anyone of you had such issue? Do you know the reason?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @gabie 

 

Please check that the data for the column 'main_folder' to ensure that it contains data and is not empty.

 

As your source data is Excel please check the Excel file for missing data or empty rows. Is there a row at the end of Excel the table, which if read returns an empty value for 'main_folder' causing the expression to fail

substring(item()?['main_folder'], 0, 4)

 


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 

View solution in original post

4 REPLIES 4
ekarim2020
Super User
Super User

Hi @gabie ,

 

Please share the flow, expressions used, along with some sample data.

 

Please also provide a screenshot of the error and where in the flow the error occurs.

 

Thanks,

 

Elllis

gabie
New Member

In general this flow is for hiding the emial under appropriate folders in outlook. The step which has error is "filter array":

gabie_0-1659693341662.png

substring(item()?['main_folder'], 0, 4), short_dCode is set as variable in previous step:
gabie_1-1659693527283.png

 

The flow is using a information from macro as an input. It's been worked for a few months without any issue.

Hi @gabie 

 

Please check that the data for the column 'main_folder' to ensure that it contains data and is not empty.

 

As your source data is Excel please check the Excel file for missing data or empty rows. Is there a row at the end of Excel the table, which if read returns an empty value for 'main_folder' causing the expression to fail

substring(item()?['main_folder'], 0, 4)

 


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 

You're right, I missed empty row, thank you for your help 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,982)