Accessing JSON Data that have Keys with Spaces

Whether it be a bug or my ignorance to common JSON practices, I found out today that parsing JSON objects into my Klips won't work unless the keys do not have spaces.  The solution was to use the contains() function rather than call the key for the field I was trying to display.




  • 0
    Larona Nyambe

    Hi Will,

    Thanks for posting in our community. What you have uncovered is not a bug, json elements whose names begin with non-alphabetic characters cannot be selected directly. See example 4 on this doc: https://support.klipfolio.com/hc/en-us/articles/215547118-About-JSON-and-XML-data-sources 

    Your solution is perfect. 


  • 0
    Daniel Verstegen

    This seems like a bug. I am unable to select using a key with non-alphabetic chars.

    The following does not work:


    While the docs say this: @day[name()='@date'] should work.

    Is it because it starts with a number?



    contains() trick works well though : )


  • 0
    Josh Cohen-Collier

    Hi Daniel,

    Sorry for the inconvenience here.

    Would you mind if we created a support ticket for this issue?
    Without seeing the actual underlying datasource, it would be difficult to say what the correct XPath would be.

    Warm regards,

  • 0
    Leann Lewis

    Ran into the same issue Daniel V. did. I'm not sure if the solution is the same but I figured I'd toss up a comment in case anyone else came here looking for this. The knowledge base article gives an example of selecting an attribute node that doesn't begin with an alphabetic character. The method the article give doesn't work with element nodes, though.

    To select an element node by name this way I had to add a wildcard (*) before the [name()=('1string')].

    For example, this did not work:


    But this did:


Please sign in to leave a comment.