@aghaei For my demo, I have the following string of text in a Compose action. Tip. Remember to rename your Compose actions to keep things organized. It will also make it easier to see which output belongs to which Compose action.

Split at Request Details
You could first split the body text at "Request Details: ". Add a Compose action. The split() function takes two parameters. The first parameter is the string of text you'd like to split. The second is the separator. You can use anything as a separator. Typically it's a punctuation mark such as a comma, colon, semi-colon etc. However you can also use strings of text.
split([string],[separator])
Start off with the split() function.

Tip: Take a look at the tool tip whenever you are composing expressions as the tooltip will bold the current parameter you are defining.
The first parameter (string) will be the string of text. Select the Dynamic content tab and select the appropriate dynamic content in your flow. In my case, it's the output of the Compose action that is storing the sample text.

Add a comma and single quotes. Between the single quotes will be the separator you'd like to split your string at. In this case it's Request Details: (note the space after the colon).

last(split([string],[separator]))
Wrap that split() function in the last() function. Go to the start of the expression by pressing the Up Arrow Key and type in last with an opening parenthesis.

Go to the end of the expression by pressing the Down Arrow Key and type in a closing parenthesis.

Your expression will look something similar to this (keep in mind the dynamic content in your case may be different and you will need to adjust accordingly.
last(split(outputs('Compose_-_Body_Text_Sample'),'Request Details: '))
Run a test. The output will be the text after "Request Details: ".

Split at How Will You Use This Information
Next, Add a Compose action.

Split the output from the previous Compose action at "How will you use this information: ". Insert the split() function, click on the Dynamic content tab and insert the output from the previous Compose action.

Just as I demonstrated in the previous section, add a comma and single quotes. Between the single quotes enter the separator. In this case it's How will you use this information: (note the space after the colon).

Wrap the split() function in the first() function to return the multi-lines of text. Go to the start of the expression by pressing the Up Arrow Key and type in first with an opening parenthesis.


You could also wrap the entire expression in a trim() function to remove any whitespace from the start and end of the string of text.

Go to the end of the expression by pressing the Down Arrow Key and type in a closing parenthesis.

Your expression will look something similar to this (keep in mind the dynamic content in your case may be different and you will need to adjust accordingly.
trim(first(split(outputs('Compose_-_Split_at_Request_Details'),'How will you use this information: ')))Run a test. You should be left with multi-lines of text (no matter the length).

Tip: If you want to reduce the amount of vertical space these actions take up in your flow—use a Scope action!

I like using Scope actions in my flow to keep things organized. You can also easily collapse multiple actions with a single click!

Hope this helps!
If I helped you solve your problem—please mark my post as a solution ✅. Consider giving me a 👍 if you liked my response!
|
You might be interested in my latest YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows
In this tutorial I cover:
✅ How to troubleshoot a false Condition action result
✅ How to get dynamic content when it isn’t selectable from the list of dynamic content
✅ How to troubleshoot an Apply to Each action that isn’t looping through
✅ How to troubleshoot a skipped Apply to Each action
✅ How to troubleshoot a Filter Query
✅ How to use a SharePoint yes/no column in a Filter Query
✅ How to use Compose actions to troubleshoot a Power Automate flow
✅How to troubleshoot multiple emails being sent
✅ How to troubleshoot multiple Teams messages being sent