Monday, 26 June 2023

Power Automate - How to split a string and loop through the splitted string in Power Automate


    1. Click on New flow and Create an Instant Cloud Flow.

        2. Enter the Flow Name, select Manually Trigger a Flow, Click on Create.


        3. Click on New Step.

    
        4. Type Compose in search box and click Compose action from Data Operation under All tab.


        5. Input some countires and seperate it with ";".


         6. Click on New Step, type initialize variable in search box and click Initialize Variable from Actions Tab.
    

        7. Select variable type as Array, Give a name to Array Variable "Split Array".
            Write an expression to split a string from compose output.
            For that, click on Add dynamic content -> Expression
            Under Expression input box, write a function Split(outputs('Compose'),';')
            Click Ok.


        8. Click on New Step, type Apply to each in search box and click Apply to each control from Actions Tab.


        9. In Apply to each action, insert Split Array from dynamic content.


        10. Under Apply to each action create a Compose action and manually input "@item()" to get splitted values.


        11. To see output, Save and Test flow and Run flow manually.

    
        12. To see iterated values, click on Next.