I am building a PWA that needs to read data from IndexedDB. I am using the JS2Bubble. Have trouble to convert the data from json to text to use it in Repeating Group.
Welcome to the forum!
Bubble can’t bind a repeating group to a JSON object/array directly. You need to pass either a list of texts (simplest) or create Bubble Things.
Easiest: in JS after reading IndexedDB, convert your array into a delimited string and send it through JS2Bubble.
// Example
const items = ["Apple", "Banana", "Orange"];
const payload = items.join("|||");
// "Apple|||Banana|||Orange"
// send payload to JS2Bubble
In Bubble set the RG data source to JS2Bubble’s value:split by "|||”.
If you need multiple fields per item, either pack each row into a string and split again, or better: push the items into Bubble DB (via backend workflow/API) and have the RG search the DB. That’s really the best way to go if you’re going to do anything other than display the data in your Bubble app.
Hi Josh
Thank you for your advise. I got it right with the split by: and find&replace and was able to display and update the indexdDB etc.
I am new to Bubble but the experience is great this far.
Norman