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

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,394)