cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mark-carlisle
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
v-micsh-msft
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
v-micsh-msft
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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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 Kudoed Authors
Users online (2,507)