cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
golfnutt82
Super User
Super User

Using an Expression to get x amount of characters from a string

Hello,
I want to get the right 25 characters in a string.
I dont see a Right function as an expression.

golfnutt82_0-1630594151870.png

Am I missing something?

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

There is no specific Right() function.  But you can do the same thing using SubStr() and Length() like this

substring(textstring,sub(length(textstring),25))


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

View solution in original post

It's good (I didn't even know that existed). So in the starting position on your example you can just use the expression:

sub(length(variables('strSiteURL')), 25)

View solution in original post

5 REPLIES 5
Paulie78
Super User
Super User

No, you are not missing anything. There is not a right function. But you can achieve it by using the substring function combined with the length function.

 

The substring takes 3 parameters, the string to substring, the starting position and the length.

 

So you need to find the length of the string, then use sub function to minus 25 from the length, then substring from the length minus 25.

 

If you need an example, I will provide.

Paulie78
Super User
Super User

Visual example better

2021-09-02_15-57-10.png

Pstork1
Dual Super User
Dual Super User

There is no specific Right() function.  But you can do the same thing using SubStr() and Length() like this

substring(textstring,sub(length(textstring),25))


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

It would be good to know that! Thanks!
I did find this action that worked.

golfnutt82_0-1630594663248.png

 

It's good (I didn't even know that existed). So in the starting position on your example you can just use the expression:

sub(length(variables('strSiteURL')), 25)

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,054)