Skip to main content

Notifications

Power Automate - General Discussion
Answered

Substring in power automate got error

(0) ShareShare
ReportReport
Posted on by 162

Hi, 

 

I would like your help about Substring function. I've using this function everyday and it can use normally. 

 

Today I got this error.  Here is my formular. 

replace(trim(substring(variables('Emailt'), add(indexOf(variables('Emailt'), 'ORGANIZATION'), 13), sub(indexOf(variables('Emailt'), 'POSTCODE: '), add(indexOf(variables('Emailt'), 'ORGANIZATION'), 13)))),variables('New Line'),' ')

nitisak_0-1673594343720.png

 

 

 

nitisak_1-1673594393988.png

 

  • nitisak Profile Picture
    nitisak 162 on at
    Re: Substring in power automate got error

    Hi @v-xiaochen-msft,

     

    I got this !! Thanks for your help. 

     

    BR.

    Nitisak. 

  • Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Substring in power automate got error

    @nitisak https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#substring

     

    Make sure that the sum from adding the startIndex and length parameter values is less than the length of the string that you provide for the text parameter. Otherwise, you get an error, unlike similar functions in other languages where the result is the substring from the startIndex to the end of the string. The length parameter is optional and if not provided, the substring() function takes all the characters beginning from startIndex to the end of the string.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • Verified answer
    Re: Substring in power automate got error

    Hi @nitisak ,

     

    Please try:


    replace(trim(Split(Split(variables('Emailt'),'ORGANIZATION')[1],'POSTCODE: ')[0]),variables('New Line'),' ')

     

    Best Regards,

    Wearsky

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,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard