Fail to extract a value from json with dot in key

I have the following json. 

{
  "notificationType": "PROFILE_UPDATED",
  "userId": "11111-22222-33333",
  "data": {
    "linkedSystems.EMPI.euid": "12345678",
    "userData.lastName": "Smith",
    "userData.firstName": "John"
  }
}


I need to extract `linkedSystems.EMPI.euid` from the above json. I tried to use ExtractVariable policy but get nothing captured. 

<ExtractVariables async="false" continueOnError="false" enabled="true" name="ExtractVariables">
  <DisplayName>ExtractVariables</DisplayName>
  <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
  <JSONPayload>
    <Variable name="empi_euid">
      <JSONPath>$.data.['linkedSystems.EMPI.euid']</JSONPath>
    </Variable>
  </JSONPayload>
</ExtractVariables>
 
The above JSONPath expression is working fine in simulator. Not sure why it is not working here.
 
Can someone help? Thanks in advance. 
 
Solved Solved
2 1 84
1 ACCEPTED SOLUTION

Either of these work for me (Apigee X)

    <Variable name='euid1'>
      <JSONPath>$.data['linkedSystems.EMPI.euid']</JSONPath>
    </Variable>

    <Variable name='euid2'>
      <JSONPath>$['data']['linkedSystems.EMPI.euid']</JSONPath>
    </Variable>

Note: no dot between data and the opening square bracket in that first example.  

View solution in original post

1 REPLY 1

Either of these work for me (Apigee X)

    <Variable name='euid1'>
      <JSONPath>$.data['linkedSystems.EMPI.euid']</JSONPath>
    </Variable>

    <Variable name='euid2'>
      <JSONPath>$['data']['linkedSystems.EMPI.euid']</JSONPath>
    </Variable>

Note: no dot between data and the opening square bracket in that first example.