4
votes

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?

1

1 Answers

3
votes

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