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 / Start index error - su...
Power Automate
Answered

Start index error - substring

(0) ShareShare
ReportReport
Posted on by 6

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?

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,683 Super User 2025 Season 2 on at

    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 Profile Picture
    6 on at

    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.

  • Verified answer
    Ellis Karim Profile Picture
    11,683 Super User 2025 Season 2 on at

    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.

     

  • gabie Profile Picture
    6 on at

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

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard