web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Substring in power aut...
Power Automate
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

 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @nitisak ,

     

    Please try:


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

     

    Best Regards,

    Wearsky

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @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

  • nitisak Profile Picture
    162 on at

    Hi @v-xiaochen-msft,

     

    I got this !! Thanks for your help. 

     

    BR.

    Nitisak. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard