cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TesDA
Continued Contributor
Continued Contributor

Take Right 6 characters of a string

For some reason I'm getting an error on this function, does anyone know how to get the right 6 characters of a string?

 

substring(

      triggerOutputs()?['body/{Name}'],

      length(triggerOutputs()?['body/{Name}'])-6,

      6)

 

Error - the expression is invalid

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@TesDA 

You need a sub() expression to subtract the number of characters from the string length.

See my example below:

image.pngimage.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

2 REPLIES 2
ScottShearer
Super User
Super User

@TesDA 

You need a sub() expression to subtract the number of characters from the string length.

See my example below:

image.pngimage.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
TesDA
Continued Contributor
Continued Contributor

Worked flawlessly. Appreciate it!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,264)