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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard