Hello,
I would like to cut out the sentence: I want to modify my report - Je veux modifier mon rapport
In order to obtain: modify my report
How do I do it?
Solved! Go to Solution.
Hi @Charline74 ,
Can you post a screenshot of your expression. If you copied and pasted, you need to add @ In front of your expression e.g. @trim(....) etc
--------------------------------------------------------------------------
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
Hi @Charline74 ,
Will the sentence always start with 'I want to' amd also include a '-'?
--------------------------------------------------------------------------
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
Hi @Charline74
Will the sentence always begin "I want to" and have a hyphen?
There are several expressions that can help you here. Split() ? which splits a string into objects of an array.
e.g. split('I want to modify my report - Je veux modifier mon rapport','-')
would give you {"I want to modify my report "," Je veux modifier mon rapport"}
There is also replace which replaces a string with another string
e.g. replace('I want to modify my report - Je veux modifier mon rapport', 'I want to ','')
would give you 'modify my report - Je veux modifier mon rapport'.
You've also got indexof('modify my report - Je veux modifier mon rapport',' - Je veux')
which would give you the exact integer of where the string ' - Je veux' appears and then by using substring(), you can create a substring of the original, based on the start and length of the substring expression.
e.g. substring('modify my report - Je veux modifier mon rapport', 0, 18)
would return 'modify my report'.
Hope that makes sense.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉
Hi @Charline74 ,
Based on your answer.
@trim(replace(first(split('I want to modify my report - Je veux modifier mon rapport','-')),'I want to',''))
--------------------------------------------------------------------------
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
Thank you, is it possible to do the same thing when the sentence is not the same all the time: Like with an answer to a question in a form that can vary
Hi @Charline74 ,
With string manipulation, you will need some sort of pattern.
Are you trying to extract intent?
--------------------------------------------------------------------------
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
Example:
This is my question with 2 possible answers:
In my flow I add this as a title for my UV
I would like to extract only "modify my report" or "create e new report" depending on the answer
Hi @Charline74 ,
Ok, got you.
You can pass the question / dynamic content into the below formula and replace the portion marked 'x' and in bold
trim(replace(first(split(xxxxxxxx,'-')),'I want to',''))
Your formula would end up looking like this
trim(replace(first(split(outputs('Get_response_details')?['body/r522d9881578c4f1e906b898025b238e7'],'-')),'I want to',''))
You can also find the dynamic content by adding it to a Compose and peeking code
--------------------------------------------------------------------------
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
I get this error message :
This is what I typed and I don't see the mistake :
Hi @Charline74 ,
Can you post a screenshot of your expression. If you copied and pasted, you need to add @ In front of your expression e.g. @trim(....) etc
--------------------------------------------------------------------------
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
42 | |
18 | |
16 | |
15 | |
13 |
User | Count |
---|---|
67 | |
36 | |
27 | |
21 | |
17 |