Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

problem in Extract Variables policy

Not applicable

Hi,

I'm trying to navigate a json message in order to extract an element's value using the Extract Variables policy but it seems doesn't work because the policy failed.

This is the json message:

{
"Header": {
"AbstractMessage": {
"DeviceRootID": "xxxxxx@gmail.com",
"CorrelationID": "xxxxxxxxxxxxxxxxxxxxxxx"
}
},
"ApartmentID": "xxxxxxxxxxxxxxxxxxx",
"isServiceAlreadyActive": null,
"UserScopes": [
"aaaaaaa",
"bbbbbb",
"xxxxxx"
],
"UserRoles": [
"uuuuuuuu"
]
}

and this is the policy configuration:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables name="getUserScopes" enabled="true" continueOnError="true" async="false">
<DisplayName>getUserScopes</DisplayName>
<JSONPayload>
<Variable name="userscopes">
<JSONPath>$.UserScopes</JSONPath>
</Variable>
</JSONPayload>
<Source clearPayload="false">ServiceCallout.response</Source>
</ExtractVariables>

I also noticed a strange behavior in this because if I delete the "Header" from the json message it works, otherwise it fails.

Can someone help me in this issue, please?

Any comments are appreciated.

Thanks,

Fabio

0 4 775
4 REPLIES 4