Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Delay completion of dynamic varibles and fuctions to pass to a child flow

(0) ShareShare
ReportReport
Posted on by 87

I am trying to build a child flow to update SharePoint lists using HTTP.  To do so I need to pass a JSON like the following to the child flow.  :

 

{
 "__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']},
 "": ""
}

 

The issue is that you can't build a JSON like this in the parent because Power Automate tries to complete the "@{item()?['...']}" functions when created and the data for item to evaluate is in the child flow.  I need to delay the dynamic completion to the correct spot in the child flow.

 

Thank you for your help.

  • PabloRoldan Profile Picture
    PabloRoldan 199 on at
    Re: Delay completion of dynamic varibles and fuctions to pass to a child flow

    Hi, you might need to review your logic not sure how you can "resolve it / eval" functions in runtime in PAF, if you copy and paste that code to a compose actions indeed it will try to refer them as expressions, so you will need to pass them as strings. 

     

    {
     "__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']}"
    }

    and scape the fx expression with @@

     

     

    regards

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard