Handling spaces in returned API query data

In one of my Hackeets I’m using a Postgresql query node. The external table I’m querying has some column titles that have spaced in them, like “Course length”. In my Hackeet flow, I’m writing the results to JSON objects with things like map(“Title”,results.title).

How do I do the same operator with a result field that contains a space? Is it like map(“Length”,results.Course length)?

I’m not sure how Hackeet handles column names containing spaces in the case of Postgresql, I’ll check it soon. What is certain is that you can’t use the result.Course length syntax. In Hackeet, attribute names cannot contain spaces or special characters such as +, -, /, @, *…and many others that can be interpreted as separators or operators (such as + or % for example). In other plugins, the policy we apply when faced with such a use case is to normalize the names by removing/replacing spaces with a “_”. I’ll post a final answer soon.

1 Like

Hi Richard,
I just checked and I confirm that column names with spaces may have undefined behavior at the moment and should be avoided for now. We have made some changes to the way Hackeet handles formulas and in the next version this should no longer be an issue.

That’s great news, thanks Thierry! For now I was able to remove the spaces from the column titles. But for future APIs where I have no control over the field names, this would be a very useful feature :wink: