I think it would help if you separated the individual expressions within the full expression for each final output you are trying to get.
The video link doesn't do a good job explaining what is going on within the expression, so it is difficult for to catch errors or adjust for any changes with your text or email.
To separate the first expression which gets the example Cookie Type there are 5 individual expressions that builds the full expression.
first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))
The full Cookie Type expression says:
- Split the email body into separate parts/items whenever the term "Quantity" appears.
split(triggerOutputs()?['body/body'],'Quantity')
- Next take the First output of the split body
first(split(triggerOutputs()?['body/body'],'Quantity'))
- Next Split the first output of the split body whenever the text colon with a space ": " appears.
split(first(split(triggerOutputs()?['body/body'],'Quantity')),': ')
- Next Skip the first item after splitting by the colon space ": "
skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1)
- Next take the First output which will be the final result of Cookie Type
first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))
To separate the second expression which gets the example Quantity there are also 5 individual expressions that builds the full expression.
first(skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1))
The full Quantity type expression says:
- Split the email body into separate parts/items whenever the term "Delivery Method" appears.
split(triggerOutputs()?['body/body'],'Delivery Method')
- Next take the First output of the split body
first(split(triggerOutputs()?['body/body'],'Delivery Method'))
- Next Split the first output of the split body whenever the term Quantity colon with a space "Quantity: " appears.
split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: ')
- Next Skip the first item after splitting by the term Quantity colon space "Quantity: "
skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1)
- Next take the First output which will be the final result of Quantity
first(skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1))
The final expression which gets the Delivery Method only has 3 individual expressions that builds the full expression. However, it will get all remaining text in the email if there is anything like a Signature Name in the email body.
first(skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1))
The full Delivery Method type expression says:
- Split the email body into separate parts/items whenever the term "Delivery Method: " appears.
split(triggerOutputs()?['body/body'],'Delivery Method: ')
- Next Skip the first 1 output item of the previous split body
skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1)
- Next take the First 1 output of the previous output
first(skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1))
I made an example flow that split the full expressions into each of it's individual expressions. The example flow uses the previous output to fill in the next expression value.
So Step A1 is the first part of the expression for Cookie Type, and then Step A2 uses the output of A1 to use it's individual expression. The final step A5 will be the same output as the full expression in A99 for cookie type.
The A99 step, B99 step, C99 step are all full expressions that would be similar to what you would use in your flow.
Full Example Flow
I separated my example flow into different Scope for each full expression.
Scope A is for the Cookie Type
Example Flow Scope A Cookie Type
Scope B is for the Quantity
Example Flow Scope B Quantity
Scope C is for the Delivery Method
Example Flow Scope C Delivery Method
The results of my example flow show how each individual part of the expression is using the outputs of the previous flow step.
I made an example Plain Text email for the trigger body.
The difference with my example email is that it has additional name signature information at the end. I included that to show that the final expression for Delivery Method will pull in additional text from the email body if it is not correctly changed for your situation.
Below is the example Email I used:
Example Email Plain Text
Below is the results of Scope A to get Cookie Type:
- Split the email body into separate parts/items whenever the term "Quantity" appears.
[
"Cookie Type: Chocolate Chip\r\n",
": 20\r\nDelivery Method: Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
]
- Next take the First output of the split body
Cookie Type: Chocolate Chip
- Next Split the first output of the split body whenever the text colon with a space ": " appears.
[
"Cookie Type",
"Chocolate Chip\r\n"
]
- Next Skip the first item after splitting by the colon space ": "
[
"Chocolate Chip\r\n"
]
- Next take the First output which will be the final result of Cookie Type
Chocolate Chip
Results Scope A Cookie Type
Below is the results of Scope B to get Quantity:
- Split the email body into separate parts/items whenever the term "Delivery Method" appears.
[
"Cookie Type: Chocolate Chip\r\nQuantity: 20\r\n",
": Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
]
- Next take the First output of the split body
Cookie Type: Chocolate Chip
Quantity: 20
- Next Split the first output of the split body whenever the term Quantity colon with a space "Quantity: " appears.
[
"Cookie Type: Chocolate Chip\r\n",
"20\r\n"
]
- Next Skip the first item after splitting by the term Quantity colon space "Quantity: "
[
"20\r\n"
]
- Next take the First output which will be the final result of Quantity
20
Full Scope B results
Scope B Results
Below is the results of Scope C to get Delivery Method
Delivery Method type expression says:
- Split the email body into separate parts/items whenever the term "Delivery Method: " appears.
[
"Cookie Type: Chocolate Chip\r\nQuantity: 20\r\n",
"Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
]
- Next Skip the first 1 output item of the previous split body
[
"Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
]
- Next take the First 1 output of the previous output
Pigeon
MYName And Signature
MyPhoneNumber 888-999-9999
Results Scope C Delivery Method
I hope these examples help you create an expression to get the information you need. It is probably best if you understand the individual expressions that are building the full expression so that you can adjust or change things to accommodate your individual situation.
Cookie Type Full Expression:
first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))
Quantity Full Expression:
first(skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1))
Delivery Method Full Expression:
first(skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1))
Let me know if this works for you,