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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,226)