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.
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.
You're welcome 😉
Which won't do me any good anyway. I hate PA. You're blocked.
Okay, wow. Please append it to an Array variable.
That's a String formatted like an Array.
No!
The function json() converts the string back to an array of objects.
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:
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.
That's a String formatted like an Array. I need an object of type Array.
That's basically my example 😉
Can it then be cast to the type Array?
OK, an example:
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:
As you can see in the child flow's Compose, the array of objects is transferred to the 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!
WarrenBelz
146,668
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional