Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Power automate - length of source string issue

(0) ShareShare
ReportReport
Posted on by 5

Hi ,

 

I've been encountering the below error on the last step of my flow - add row into a table. I'm unsure what is triggering this issue? The flow is to extract the email content when it arrives into a Share mailbox and to feed the email content into a excel table. 

 

The length of substring can't be longer than '1813' which is the length of the source string.

 

Would someone be able to shed light what this error could mean?

 

Appreciate any help. 

 

  • auswtz Profile Picture
    auswtz 5 on at
    Re: Power automate - length of source string issue

    Hi Eric,

     

    Here's an example of what I'm trying to do.

     

    Page title: 

    Feedback:

    Sentiment:

     
    Page Title substring
    substring(triggerBody()?['Body'],add(indexOf(triggerBody()?['Body'],'Page title:'),11),sub(indexOf(triggerBody()?['Body'],'| Feedback:'),add(indexOf(triggerBody()?['Body'],'Page title:'),11)))
     
    Feedback Substring
    substring(triggerBody()?['Body'],add(indexOf(triggerBody()?['Body'],'Sentiment:'),22),sub(indexOf(triggerBody()?['Body'],'Feedback:'),add(indexOf(triggerBody()?['Body'],'Sentiment:'),22)))

     

    I'm a complete newbie and the substring I've used are borrowed from previous comments in the forum. 

     

    I have a feeling it may have something to do with the email arriving on the shared mailbox which seems to be where the error is occurring. I say this because if I forward the email from the shared mailbox to myself, the flow works perfectly fine? Could it be caused by the extra lines when the email arrives in the shared mailbox?

     

    auswtz_0-1628650740878.png

     

  • eric-cheng Profile Picture
    eric-cheng 5,171 on at
    Re: Power automate - length of source string issue

    Hi @auswtz ,

     

    Can you post your substring formula?

     

    Without seeing your formula, I suspect your third parameter is causing an issue.

     

    Substring takes in 3 parameters:

     

    * Source string - the original piece of text

    * Start index - the index/position where you want to start extracting from

    * Length - the number of characters you want to extract (from the start index)

     

    An example is below:

     

    Apple

     

    substring('apple', 1, 3) would return app

    substring('apple', 2, 3) would return ppl

     

    Check your length parameter isn't set to 1813 if your start index is greater than 1 because it will try to extract past the end of your text .

     

    Try this online substring tester to plug in your values and test it out.

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard