Parsing JSON data with spaces in built-in field names


i encoutered a problem while setting up my REST request in Talend, to query data from the Bubble API.
The returned type is JSON, but some of the default names for attributes contains spaces (Modified Date, Created By), which seem incompatible with JSON parsers (the JSON parser does not allow it, the XPath one does not event open the file).

[com.jayway.jsonpath.InvalidPathException: Space not allowed in path]

As it does not seem posible to edit built-in field names (and replace spaces by underscores), does anyone know a turnaround for this ?

Many thanks in advance.

remove spaces and capitalization in field names. Check out the Bubble reference docs for details.

Yes, i would like to. I does not seem to be able to edit built-in field names like “Modified Date”.
Am i doing something wrong ?

In your API configurations, you need to remove spaces and capitalization. You cannot edit system field names.

So it sounds like you are pulling data from Bubble into Talend, right? What are you trying to do with the returned data? It’s perfectly valid to have spaces in JSON field names. It’s not entirely clear that parsing is the problem.

1 Like

Exact @sudsy , i am pulling data from Bubble into Talend through a tRESTclient, then parse the fields with a tExtractJSONfields using loop Jsonpath query “$.response.results[*]” and Json query “Modified Date”.
Everything works fine with all other queries including “_type” and “_id”.

On Talend forum, i read the following : " It is not allowed to contains a space in the column name, because Talend studio is a Java code generator, each column will be variable in the job class. A variable name can not contains a space in Java. You need to replace the space with other character such as “_”.

OK, then that’s a Talend requirement/limitation. It has nothing to do with parsing the JSON (which seems to be happening just fine).

I’m not familiar with Talend, but if you can “intercept” the JSON and insert an underscore (or simply omit those fields if you don’t need them), that might be a way to go. (I don’t know if/how you can change the name of built-in fields on the bubble end.)

Thank you @sudsy, this is pretty easy to implement in Talend, i’ll do that. Did not tought of it myself.