Using REGEX_MATCH to parse XML retuned by connector function

I’m currently using a connector function to integrate with out CMMS, Mainsaver. The request and response are both in XML instead of JSON.

The real problem is that the connector function only support Apache Freemarker 1.0 but Mainsaver uses a newer version, so I can’t parse out the response within the connector function . This requires me to process the whole response into variables using RegEx in App triggers.

I have it “working” but it’s saving both the full RegEx match (index 0), and the group match (index 1) as an array, which makes it more difficult to work with.

For example I’m using the following to extract the status of the response:
\<Status\>(.*)\<\/Status>

So for instance the resultant array index 0 is <Status>OK</Status>, and index 1 is what I want, which is just OK.

Is there a way to ONLY return index 1? Or if not, trim the output to index 1 and save to a variable?

I don’t want to paste private info here so sorry no screenshots but if I can find a way to sanitize the data I’ll try to add some examples.

Here’s my current solution, but I don’t like it because I have to create useless intermediate variables:

Most of our connector outputs are XML. Do you have a sample output?

@Richard-SNN
At the risk of misunderstanding you: Did you try XPath right in the Connector function?

I gave it a try with the jokes API for testing. I don’t know why, but it always delivers the tags as part of the value. But I found a workaroud for this as well:

Is this helpful for you or did I get you wrong?

@Pete_Hartnett Is this point with the tags in the result a bug?

Yes, my understanding is that xpath 1.0 does not like it when the xmlns is in the first node and nothing is returned. When Xpath is updated, I should be able to get it to work.

Final workaround until Xpath is updated: