web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Answered

Split String

(0) ShareShare
ReportReport
Posted on by 42

Hello, 

 

I can recover these sentences following a response to a questionnaire

- I want to create a new report

- I want to update an existing report

- I want to fix a bug in my report

 

And I'd like to know how I can split them to have just :

- create

- update

- fix a bug

 

Does anyone know how to do this ?

 

Thanks

 

Categories:
I have the same question (0)
  • AlexEncodian Profile Picture
    4,409 Moderator on at

    @Charline_74 

    You can use compose and a replace function to replace "I want to ", " a new report", " an existing report" and " in my report" from the input string that you have previously extracted. Your output will be "create", "update", and "fix a bug"

  • Verified answer
    Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Why do you want to use split? It seems that you have some strings and want to convert it to something else (ok, in this case the sonething else is part of the string).

     

    I would suggest to create an JSON-Object to do the transformation. Something like this:

     

     

    {
     "I want to create a new report": "create",
     "I want to update an existing report": "update",
     "I want to fix a bug in my report": "fix a bug"
    }

     

    You will get the correct output with this formular: 

    coalesce(outputs('Compose_Transformation')?[TEXTTOTRANSLATE], 'ERROR')
  • Charline_74 Profile Picture
    42 on at

    Hi @Matthy79 

    Can you give me an example of the connectors used?

    I use this dynamic content :

    Charline_74_0-1687158238096.png

    to retrieve the answer to the question I want to split.

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    I don't use a connector. It is just a simple "Compose" action where you put in the JSON. And do get your translation you can use the formula. But if that is too less information, please provide a sample output of your JSON that needs to be processed.

  • Charline_74 Profile Picture
    42 on at

    Hi @Matthy79

    I don't really understand how you do it.

     I have a Microsoft Form in which I have this question:

    Charline_74_0-1687162221781.png

    And basically I get the answer to this question via this dynamic content:

    Charline_74_2-1687162380984.png

    And I'd like to split the answer into create, update or fix a bug.

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    I do understand the question but do you have a JSON-Sample from the trigger? Just create a test entry and from that run you post the complete body of the trigger (run history) here. Maybe this sample helps you to understand. You can use the clipboard to create it in a sample flow:

     

    {"id":"f5c96a06-1ce1-4ef2-afcb-181d933a10c8","brandColor":"#8C3900","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/shared-sharepointonl-b959cb53-5ecb-4b41-805f-06e7795a0bd2"}},"shared_commondataserviceforapps":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps/connections/62947705b1a746319ca1e59aae985afc"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope_Transformation","operationDefinition":{"type":"Scope","actions":{"Compose_Sampletext_from_Form":{"type":"Compose","inputs":"I want to update an existing report","runAfter":{}},"Compose_Transformation_Object":{"type":"Compose","inputs":{"I want to create a new report":"create","I want to update an existing report":"update","I want to fix a bug in my report":"fix a bug"},"runAfter":{"Compose_Sampletext_from_Form":["Succeeded"]}},"Extracted_text":{"type":"Compose","inputs":"@coalesce(outputs('Compose_Transformation_Object')?[outputs('Compose_Sampletext_from_Form')], 'ERROR')","runAfter":{"Compose_Transformation_Object":["Succeeded"]}}},"runAfter":{}}}

     Of course you won't need step 1 (you already have the data in the trigger) and 3 (just do demonstrate the output) but I hope this helps to understand.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard