Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SboibWn3aOcOCFU42x9cgr
Power Automate - General Discussion
Unanswered

Allow to pass an array to a child flow

Like (3) ShareShare
ReportReport
Posted on 4 Dec 2021 15:55:20 by 307

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.

  • Chriddle Profile Picture
    7,678 Super User 2025 Season 1 on 11 Apr 2024 at 21:38:11
    Re: Allow to pass an array to a child flow

    You're welcome 😉

  • jogram Profile Picture
    129 on 11 Apr 2024 at 21:24:59
    Re: Allow to pass an array to a child flow

    Which won't do me any good anyway. I hate PA. You're blocked.

  • jogram Profile Picture
    129 on 11 Apr 2024 at 21:14:19
    Re: Allow to pass an array to a child flow

    Okay, wow. Please append it to an Array variable.

  • Chriddle Profile Picture
    7,678 Super User 2025 Season 1 on 11 Apr 2024 at 21:01:22
    Re: Allow to pass an array to a child flow
    That's a String formatted like an Array.

    No!

     

    The function json() converts the string back to an array of objects.

  • AlexLindberg Profile Picture
    87 on 11 Apr 2024 at 20:11:24
    Re: Allow to pass an array to a child flow

    There are several ways to pass an object from Parent to Child.  The issue is when that object in the parent needs to pass a dynamic variable that must be resolved in the child.

     

    As an example: The child is created to do an HTTP SharePoint request.  The body of the HTTP widget is created in a Select such as:

     

    AlexLindberg_0-1712865004328.png

     

    The Select's from field is: @{body('ArrayOfAccountsToBeUpdated')} 

    The JSON for the MAP is:

    {
     "__metadata": @{json(concat('{"type":"SP.Data.', replace(replace(outputs('SettingsCDRAccounts')['listName'], ' ', '_x0020_'),'-',''), 'ListItem"}'))},
     "ID": @{xpath(xml(outputs('XMLSPArray-CDR-Accounts')),concat('string(//Array[Title/text()="', item()['Id'],'"]/ID/text())'))},
     "Title": @{item()?['Id']},
     "LastModifiedDate": @{item()?['LastModifiedDate']},
     "AccountName": @{item()?['Name']},
     "AccountTheater": @{item()?['Theater__c']},
     "AccountRegion": @{item()?['Operation_Region__c']},
     "AccountArea": @{item()?['Area__c']},
     "AccountNumber": @{item()?['Account_Number__c']},
     "": ""
    }

     This example is based on Batch Update, Create, and Upsert SharePoint Lists by @takolota. Much faster than the standard SharePoint Update and Insert applets. 

     

    I need to pass the JSON used by the Select object from the parent to the child.  The issue is that the "from" data is only available to the child, not the parent.  Thus the dynamic functions will not resolve in the parent hence it can't be passed to the child.

     

    It has been suggested that you can pass the dynamic variables as strings to delay their resolution, but I have not yet accomplished it.

  • jogram Profile Picture
    129 on 11 Apr 2024 at 18:45:04
    Re: Allow to pass an array to a child flow

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

  • Chriddle Profile Picture
    7,678 Super User 2025 Season 1 on 11 Apr 2024 at 16:08:20
    Re: Allow to pass an array to a child flow

    That's basically my example 😉

  • jogram Profile Picture
    129 on 11 Apr 2024 at 15:52:23
    Re: Allow to pass an array to a child flow

    Can it then be cast to the type Array?

  • Chriddle Profile Picture
    7,678 Super User 2025 Season 1 on 11 Apr 2024 at 14:34:52
    Re: Allow to pass an array to a child flow

    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 11 Apr 2024 at 12:20:16
    Re: Allow to pass an array to a child flow

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

     

    Low code rapid application development my big toe!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard