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 / 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
    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

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

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard