Sure. See below in red. Please note that some expressions has a dependency on the previous expression.
1. Compose - passed the value of your string
2. Compose 2 - performed a split on hyphen -
@split(outputs('Compose'),'-')
This expression takes the string from your Compose action. It will then split the string based on the locations of '-' into an array. As you string will have 3 '-', it will have 3 items in the array.
Item 1 = Mary Lee
Item 2 = Michael Terry 4217 Liberty
Item 3 = BR476598 (WO# 1754961)
3. Customer Name
@trim(first(outputs('Compose_2')))
This will take Item 1 from above (first()) and then use trim() to get rid of all the white spaces before and after.
4. Customer ID
@substring(trim(last(outputs('Compose_2'))),0,indexOf(trim(last(outputs('Compose_2'))),'(WO#'))
This will take Item 3 from above (last()) and then use trim() to get rid of all the white spaces before and after.
It will then use substring() to extract BR476598. Substring takes in 3 parameters being, the original string, the starting point and how many characters you want to extract. To get the last parameter, we use indexOf to find the location / location within the string of WO#.
5. Work Order ID
@replace(trim(last(split(trim(last(outputs('Compose_2'))),'(WO#'))),')','')
To get work order ID, we assumed we got the customer ID correctly. We then take the string from Item 3 and then look for the Customer ID and remove it. This will leave only the Work Order ID.
Contractor Name will be quite hard to distinguish the name from 4217 Liberty but i'll wait for your response to my earlier question. If it will always have a number after the name, there is a chance.
@outputs('Compose_2')[1]
To get contractor name, we get Item 2. To do this we need to reference the index (which starts at 0), so Item 1 = Index 0, Item 2 = Index 1 and Item 3 = Index 3 etc.
Let me know if you need further assistance.
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn