Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Connect 2025! Join us in Orlando join us for 3 days of immersive learning: REGISTER TODAY

How to solve issues with Invalid JSONPath errors

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Marius_Nuca
Support
Support

How to solve issues with Invalid JSONPath errors

Last Update:

Nov 12, 2021 4:10:20 AM

Updated By:

Marius_Nuca

Created date:

Nov 9, 2021 4:40:28 AM

Attachments

If you are reading this article that means you encountered this error when running one of our automations. This happens whenever you try to access the value of a key inside an object directly by name but the name either contains special characters not present in the UTF-8 format or contains special characters like empty space ' ' character, '/' character, '.' character and a few other choice characters that hold special meaning in the PHP interpreter.

Workaround for this is to encase the whole key name in apostrophes '' so as to let the interpreter know exactly how to read that certain key. Renaming the key works as well but sometimes keys like this need to be sent as they are to other platforms so it might not always apply.

I have attached a quick JSON example of how to workaround the issue and also how you can experience the error yourself if you enable the Output 8 block inside that automation.

 

But let us go through the example step by step and understand this better. In the first block I created an object with two items in it both containing special character keys, restricted character keys as well as normal keys too.

Marius_Nuca_0-1636450261382.png

 

If you want to show the whole item in the output, this does not cause any issues. But if you want to use the values of special char keys like I did in the conditional block then we need to add the ''.

Marius_Nuca_1-1636450313233.png

The end result of a run for our testing automation example should be looking like the following image:

Marius_Nuca_2-1636450692504.png

If by any chance this solution is not working for you we have a secondary workaround and that is to treat the whole tag as a member of a list:

{ $.listAccounts.item['emt_labcommercialytd_date@OData.Community.Display.V1.FormattedValue'] }

Hope this explanation and example helps you guys moving forward with your own automations.

 

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

 

Labels (2)
Comments
bkennedy
Partner - Contributor
Partner - Contributor

Hi Marius, thanks for the great post, but I am still struggling with this issue:

(The fields that I am trying to populate the object variable with, has a naming convention of db.64 (prefix), so it seems that Qlik thinks it is a level down if that makes sense?

bkennedy_0-1668070018680.png

 

This is what it looks like when I select:

bkennedy_1-1668070110816.png.

the result the (for the Value):

bkennedy_2-1668070163685.png

with the following error then:

bkennedy_3-1668070196297.png

 I have tried {$.loop2.item.'db64.refnr'} but no luck, any ideas? 

 

Contributors
Version history
Last update:
‎2021-11-12 04:10 AM
Updated by: