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

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 III
Dual Super User III

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 III
Dual Super User III

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

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,160)