cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
claudia
Helper IV
Helper IV

Substract 3 characters from a string

Hi everyone,

 

I need some help with building a flow. I hope somebody can give me a hand.

 

I need to substract the last 3 characters from a string which looks like this: nnnnnn-an

where: n is numerical

           a is alphanumerical

I understood that I can use "substring" function, but I need to understand how to use it so, I will need also some explanations

 

If anyone can provide me some explanation or send me some links to documentation related to Functions, it will be highly appreciated.

 

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @claudia ,

 

Please refer to screenshot below to create the flow:

1.png

 

The expression in the Compose 2 as below:

substring(outputs('Compose'),sub(length(outputs('Compose')),3),3)

 

Best regards,
Alice       
 
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User
Dual Super User

Basically you need to use Substring(), Sub() and Length() to do what you want.  This would be the formula

substring(textfield,0,sub(length(textfield),3))

This takes the textfield, starts at the beginning (position 0) and returns everything up to the length of the string minus 3 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
v-alzhan-msft
Community Support
Community Support

Hi @claudia ,

 

Please refer to screenshot below to create the flow:

1.png

 

The expression in the Compose 2 as below:

substring(outputs('Compose'),sub(length(outputs('Compose')),3),3)

 

Best regards,
Alice       
 
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,757)