Save and use JSON in a Data type Field

Hello guys!

I’m writing to you because I’m completely stuck.

Do you know if it is possible to use a Json (saved in a data type field in text format) in a repeating group?

Let me explain:

I’m developing a small SEO tool, one of whose features is the ability to type in a keyword and receive a list of suggestions for similar keywords.

To do this, I use an API that sends me back a JSON with a list of keywords in array, along with several important pieces of information for each one (search volume, CPC etc…).

As the list of suggested keywords is very long (around 200 keywords for each query), I don’t want to save each item in the list in my database as a data type. This would be far too cumbersome, bearing in mind that each user would be entitled to carry out around thirty searches per month.

My solution: save the JSON in a “search_response” data type, in a field text.

So far so good, I’ve got my JSON in the field.

My problem: I have a dedicated “search results” page, where the user should be able to see the list of suggested keywords and their associated information (CPC, search volum etc…).
Knowing that all this information is contained in JSON, how can I retrieve it and use it in a repeating group?

I’ve already done some research on the forum, and one solution would seem to be to create an API call to my own database (use as data) so that I can then retrieve this json.

Unfortunately, the JSON is contained in a specific field of my data type, so the API call doesn’t return the JSON directly.

As a result, I can’t use it in my repeating group…

I don’t know if I’m making myself clear, but to sum up :

Is it possible to use the JSON contained in the “json” field (text type) of my “Search_response” data type?

Any idea ?

Thanks in advance!

Update to my own problem : a friend gave me the solution.

First, I set a backend worfklow with the JSON as text in parameter, then use the action “return data from API”.

Then I’ve created an Api call that trigger this backend by sending the data type containing the JSON in its field… et voilà !

In API connector, you can also swtich “JSON” in data type field for “TEXT”
You can activate include erros in response + capture response headers to have access to raw body (JSON as text)

Finally, you can also save the whole payload as an API type field (like another DB type field). But this depend of what you will do with this data.

Thanks for the tips Jici !

In fact that’s what I’ve done. I saved the json as a raw text in the text field of my data type.

Then I used my backend workflow to parse this text as a Json, in order for Bubble to detect all the objects inside it.

This way I can now use it easily in a RG with dynamic expressions :slight_smile:

1 Like