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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to split a string ...
Power Automate
Answered

How to split a string from Powerapps in order to have two separate variables

(0) ShareShare
ReportReport
Posted on by 36

Hello everybody,

I'm currently developing an app where data is saved in a collection. Then this collection needs to fill an excel template which has an specific format. 

I did a flow that gets the data from the collection in power apps in string format onto a variable, then a Parse JSON that sets this variable to a table format that is used to fill the excel template. 

 

This works great, but now i need to get two collections from the app in order to fill two different tables in the same excel template. After some searching i found out that i could pull a single string from my app and then split it onto two different variables, but i dont know how to do it. I need help splitting this one string onto two variables: Data1 and Data2. 

 

All help is apreciated . 

This is my current flow:

 

LautaroLopez_0-1696615445037.png

 

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,969 Moderator on at

    Hi @LautaroLopez 

     

    I do not see clearly what string you are trying to split? and how do you want it split?

    Cannot tell you without that information.

    Is it a property of JSON that you can get via Dynamic Properties?

     

    Happy to help just need the information.

     

    Here is the high level gyst.

     

    Add an Initialize Variable

    In the value you would type something like this

    split(MyValueHere,'mydelimterhere')[0] // where 0 is the index of the first thing returned in the split
    
    
    split(MyValueHere,'mydelimterhere')[1] // would return the second
    
    so if your string is "Help me I am ; falling down quickly"
    
    
    split('Help me I am ; falling down quickly', ';')[0] = Help me I am 
    split('Help me I am ; falling down quickly', ';')[1] = falling down quickly 
    
    

     

    If this solves your problem, please mark my answer is Resolved/Answered and maybe even a thumbs up.

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • LautaroLopez Profile Picture
    36 on at

    Hi @FLMike !

    This is the string that comes from the collections in power apps:

    LautaroLopez_2-1696618483134.png

     

    The full is: 

    [{"C1":"nombre"},{"C1":" "},{"C1":"numero"},{"C1":"parte"},{"C1":" "}]#[{"ATitle":"1.1","Frecuencia":"OK","Registro":"OK","Valores":"OK","ZComentarios":"this is ok"},{"ATitle":"1.2","Frecuencia":"N/A","Registro":"N/A","Valores":"N/A","ZComentarios":"not available"},{"ATitle":"1.3","Frecuencia":"NG","Registro":"NG","Valores":"NG","ZComentarios":"bad item"}]

     

    My button in powerapps looks like this:

    LautaroLopez_3-1696618548611.png

     

    I want a variable called Data1 type string with only C1 things, then Data2 also type string with the rest of the stuff. My separator is #.

     

    Thank you!!

     

     

     

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at

    Hi @LautaroLopez 

     

    Sure based on your screen here is how

    NOTE: I believe your variable is called DataItemsExportar   please check the spelling and if I am wrong, please fix the spelling when you paste in my Expressions

     

    1. Create 2 more Initialize Variables

    2. Make them both strings

    3. Call the first Data1

    4. Call the second Data2

    5. In Data 1 Value, click there. When the popup windows shows, click the Expression Tab and then paste this in

     

    split(variables('DataItemsExportar'),'#')[0]

    and hit Ok button

     

     

    6. In Data 2 Value, click there. When the popup windows shows, click the Expression Tab and then paste this in

     

    split(variables('DataItemsExportar'),'#')[1]

     

    and hit Ok buton

    And done.

     

    As this answers your question, I would love if you could mark my answer as Resolved/Answered and maybe even a thumbs up.

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey 

  • LautaroLopez Profile Picture
    36 on at

    Thank you @FLMike !!!

    It worked like a charm 😄

    LautaroLopez_0-1696692928410.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard