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 Platform Community / Forums / Power Automate / Allow to pass an array...
Power Automate
Unanswered

Allow to pass an array to a child flow

(3) ShareShare
ReportReport
Posted on by 309

It's frustrating that we can't pass a simple array to a child flow.  Please allow such data to be passed without having to convert to string and rebuild an array in the child flow.

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @Mate @testasdfasfsafa 

     

    True, as of now the recipe is to Convert array to string -> Parent Flow -> 

    string(variables('ArrVar'))
     
    In Child Flow -> Convert string to array -> 
    split(triggerBody()['text'],','
     
    Personally - I think Microsoft should allow array variables in child Flow - I have created an Idea at - 
     
    In future if you have any awesome idea please submit it at https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas 
    Please Vote - Up.
     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     
     
  • AlexLindberg Profile Picture
    87 on at

    I have the same issue.  One suggested solution was to use string(array_data) in the parent flow then use split(passed_string, ',') in the child flow. This did not work for me.

     

    Example - Source Array:

     

    [
     {
     "Title": "Title Line 11",
     "Field_x0020_1": "Text Field 1 xxxx",
     "Number_x0020_Field_x0020_2": 12345
     },
     {
     "Title": "Title Line 2",
     "Field_x0020_1": "Text Field 21 yyy",
     "Number_x0020_Field_x0020_2": 545331
     },
     {
     "Title": "Title Line 3",
     "Field_x0020_1": "Text Field 3 zzzz",
     "Number_x0020_Field_x0020_2": 44.55
     },
     {
     "Title": "This is a new line",
     "Field_x0020_1": "Updated Row abcd",
     "Number_x0020_Field_x0020_2": 1112233
     }
    ]

     

     

    The result of string()

     

    [{"Title":"Title Line 11","Field_x0020_1":"Text Field 1 xxxx","Number_x0020_Field_x0020_2":12345},{"Title":"Title Line 2","Field_x0020_1":"Text Field 21 yyy","Number_x0020_Field_x0020_2":545331},{"Title":"Title Line 3","Field_x0020_1":"Text Field 3 zzzz","Number_x0020_Field_x0020_2":44.55},{"Title":"This is a new line","Field_x0020_1":"Updated Row abcd","Number_x0020_Field_x0020_2":1112233}]

     

    So far so go.

     

    This data then looks like this when passed to the child flow as text:

     

    [{"Title":"Title Line 11","Field_x0020_1":"Text Field 1 xxxx","Number_x0020_Field_x0020_2":12345},{"Title":"Title Line 2","Field_x0020_1":"Text Field 21 yyy","Number_x0020_Field_x0020_2":545331},{"Title":"Title Line 3","Field_x0020_1":"Text Field 3 zzzz","Number_x0020_Field_x0020_2":44.55},{"Title":"This is a new line","Field_x0020_1":"Updated Row abcd","Number_x0020_Field_x0020_2":1112233}]

     

    Still good.

     

    Now split(string data,',')

     

    [
     "[{\"Title\":\"Title Line 11\"",
     "\"Field_x0020_1\":\"Text Field 1 xxxx\"",
     "\"Number_x0020_Field_x0020_2\":12345}",
     "{\"Title\":\"Title Line 2\"",
     "\"Field_x0020_1\":\"Text Field 21 yyy\"",
     "\"Number_x0020_Field_x0020_2\":545331}",
     "{\"Title\":\"Title Line 3\"",
     "\"Field_x0020_1\":\"Text Field 3 zzzz\"",
     "\"Number_x0020_Field_x0020_2\":44.55}",
     "{\"Title\":\"This is a new line\"",
     "\"Field_x0020_1\":\"Updated Row abcd\"",
     "\"Number_x0020_Field_x0020_2\":1112233}]"
    ]

     

    Yep - Not so good...

     

    The same data when the parent flow - base64(string(DataToPass)) then child flow json(base64tostring(passed_Data)).  - Suggestion found in Reddit  posed by https://www.reddit.com/user/ItsOtisTime/

    String passed to child flow:

     

    "W3siVGl0bGUiOiJUaXRsZSBMaW5lIDExIiwiRmllbGRfeDAwMjBfMSI6IlRleHQgRmllbGQgMSB4eHh4IiwiTnVtYmVyX3gwMDIwX0ZpZWxkX3gwMDIwXzIiOjEyMzQ1fSx7IlRpdGxlIjoiVGl0bGUgTGluZSAyIiwiRmllbGRfeDAwMjBfMSI6IlRleHQgRmllbGQgMjEgeXl5IiwiTnVtYmVyX3gwMDIwX0ZpZWxkX3gwMDIwXzIiOjU0NTMzMX0seyJUaXRsZSI6IlRpdGxlIExpbmUgMyIsIkZpZWxkX3gwMDIwXzEiOiJUZXh0IEZpZWxkIDMgenp6eiIsIk51bWJlcl94MDAyMF9GaWVsZF94MDAyMF8yIjo0NC41NX0seyJUaXRsZSI6IlRoaXMgaXMgYSBuZXcgbGluZSIsIkZpZWxkX3gwMDIwXzEiOiJVcGRhdGVkIFJvdyBhYmNkIiwiTnVtYmVyX3gwMDIwX0ZpZWxkX3gwMDIwXzIiOjExMTIyMzN9XQ=="

     

     

    String received in child flow:

     

    W3siVGl0bGUiOiJUaXRsZSBMaW5lIDExIiwiRmllbGRfeDAwMjBfMSI6IlRleHQgRmllbGQgMSB4eHh4IiwiTnVtYmVyX3gwMDIwX0ZpZWxkX3gwMDIwXzIiOjEyMzQ1fSx7IlRpdGxlIjoiVGl0bGUgTGluZSAyIiwiRmllbGRfeDAwMjBfMSI6IlRleHQgRmllbGQgMjEgeXl5IiwiTnVtYmVyX3gwMDIwX0ZpZWxkX3gwMDIwXzIiOjU0NTMzMX0seyJUaXRsZSI6IlRpdGxlIExpbmUgMyIsIkZpZWxkX3gwMDIwXzEiOiJUZXh0IEZpZWxkIDMgenp6eiIsIk51bWJlcl94MDAyMF9GaWVsZF94MDAyMF8yIjo0NC41NX0seyJUaXRsZSI6IlRoaXMgaXMgYSBuZXcgbGluZSIsIkZpZWxkX3gwMDIwXzEiOiJVcGRhdGVkIFJvdyBhYmNkIiwiTnVtYmVyX3gwMDIwX0ZpZWxkX3gwMDIwXzIiOjExMTIyMzN9XQ==

     

     

    Decoded string in child flow (as seen in a variable)

     

    {
     "variables": [
     {
     "name": "v_SourceDataArray",
     "type": "Array",
     "value": [
     {
     "Title": "Title Line 11",
     "Field_x0020_1": "Text Field 1 xxxx",
     "Number_x0020_Field_x0020_2": 12345
     },
     {
     "Title": "Title Line 2",
     "Field_x0020_1": "Text Field 21 yyy",
     "Number_x0020_Field_x0020_2": 545331
     },
     {
     "Title": "Title Line 3",
     "Field_x0020_1": "Text Field 3 zzzz",
     "Number_x0020_Field_x0020_2": 44.55
     },
     {
     "Title": "This is a new line",
     "Field_x0020_1": "Updated Row abcd",
     "Number_x0020_Field_x0020_2": 1112233
     }
     ]
     }
     ]
    }

     

     Success!!!

     

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Just use functions string() and json() to convert objects or arrays to a (JSON) string and back to an object.

  • jogram Profile Picture
    129 on at

    Explain

  • AlexLindberg Profile Picture
    87 on at

    I tried to write a parent/child flow in which the parent passed a JSON array to be used in a select to build an HTTP body.  There are two issues, 

    1) only strings are acceptable as a variable type (there  are ways to fix this)

    2) I can seem to pass dynamic values like @{item()?['Title']}. The intent is to have the child's select statement use the passed JSON array.

  • jogram Profile Picture
    129 on at

    I think I'm just going to take the logic out of my child flow. 

     

    Low code rapid application development my big toe!

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    OK, an example:

    Chriddle_0-1712845611645.png

    Left side: the parent flow

    The Select creates an array of objects.

    The "Run a Child Flow"s input takes this object and stringifies it:

     

    string(body('Select'))

     

     

     

    Right side: the child flow

    The Compose's input:

     

    json(triggerBody()['text'])

     

     

    The flow runs look like this:

    Chriddle_1-1712845925022.png

    As you can see in the child flow's Compose, the array of objects is transferred to the child flow.

  • jogram Profile Picture
    129 on at

    Can it then be cast to the type Array?

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    That's basically my example 😉

  • jogram Profile Picture
    129 on at

    That's a String formatted like an Array. I need an object of type Array.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard