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

Find the length of a string to use in substring

I want to extract information from the body of an email and populate fields in a SharePoint. An extract of the email is follows;

 

Details

------------------------------------------------------------

Account Number 99999999

Contact Name Mr A N Other

Email example@domain.com

Telephone 0123456789

Incident Reference XXXXX-XXXXX


I've solved the fixed length data but I'm having issues with the varaible length data like Email. The expression I am using is;

 

substring(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),'Email ', 6),X)

Where 'X' will be the length of the email address which is where I'm struggling to find a way to find the length of a string.

 

Any suggestions would be appreciated.Capture.PNG

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @mark-carlisle,

 

Would it be available to take use of the LastIndexof function here?

 

For example, if here you would like to get the Email length, then we could write the formula as this:

Sub(
LastIndexOf(body('Html_to_text'), 'Telephone'),
Add(LastIndexOf(body('Html_to_text'),'Email '), 6)
)

Regards,

Michael

 

Community Support Team _ Michael Shao
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
Community Support
Community Support

Hi @mark-carlisle,

 

Would it be available to take use of the LastIndexof function here?

 

For example, if here you would like to get the Email length, then we could write the formula as this:

Sub(
LastIndexOf(body('Html_to_text'), 'Telephone'),
Add(LastIndexOf(body('Html_to_text'),'Email '), 6)
)

Regards,

Michael

 

Community Support Team _ Michael Shao
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

That worked great.

 

Thanks

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (6,388)