0

For example this is the output I get from Web activity:

`{
    "Response": "<?xml version = 'xyz'?>
                 <Head>
                      <Blobs>
                             <Blob>
                                  <Name>Max</Name>
                                  <location>USA</location>
                             </Blob>
                             <Blob>
                                  <Name>Robert</Name>
                                  <location>UK</location>
                             </Blob>
                             <Blob>
                                  <Name>Nick</Name>
                                  <location>USA</location>
                             </Blob>
                       </Blobs>
                  </Head>",
    "Json1": {
        "Json1_1": "value",
        "Json1_1": "value",
        "Json1_1": "value",
    },
    "Json2": "value",
    "Json3": 0,
    "Json4": {
        "json4_1": 0`your text`
    }
}`

I want to get all Names from XML data. So I am using set variable activity and taking the web activity output as input.

I tried using expression: @xpath(xml(activity('Web1').output.Response), 'string(//Name)') This is giving me only first name of the xml but I want all the name tag values from the XML above. The variable I used in the set varibale activity was array type.

Can someone help me to get all the name values from the output of web activity.

Thanks in advance.

Aswin
  • 4,090
  • 2
  • 4
  • 16
pikapika
  • 1
  • 1

1 Answers1

0

I have repro'd this in my environment.

  • A sample API is taken in web activity and its XML response is as in below image.

enter image description here

  • Then Variable V1 (array type) is taken and it is set using set variable activity. Value is given as @xpath(xml(activity('Web1').output.Response), string('//Name/text()')) enter image description here

Output of Set Variable Activity: It has all names from XML response. enter image description here

Aswin
  • 4,090
  • 2
  • 4
  • 16