4

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?

dreftymac
  • 31,404
  • 26
  • 119
  • 182
Kiran R
  • 41
  • 1
  • 2

1 Answers1

3

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://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

Derek Li
  • 3,089
  • 2
  • 25
  • 38