简体   繁体   中英

Update json in logic apps

I want to parse through a json and update specific nodes in json result according to the following code snippet written in power shell:

    foreach($val in $getresult.elements.values)
              {
                if($val.Name -eq "Config")
                {
                    $val.items.Service=$ServiceValue
                }
                if($val.Name -eq "Analysis")
                {
                    $val.items.ID=$IDValue
                    $val.items.Name=$NameValue
                }
                if($val.Name -eq "Report")
                {
                    $val.items.to=$ToValue
                }
              }

The final $getresult elements/nodes should be updated with $ServiceValue , $NameValue and $ToValue . How do I achieve it in logic apps?

We recently introduced new workflow functions @setProperty , in combination with condition action you will be able to set the properties inside. Or, use @addProperty if such name doesn't exist.

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM