Only unique elements in API array

I’m firing the following API call to my Bubble app:

Postman returns a OK200 and the data is received by Bubble:

However, duplicate values in an array are ignored, the first image show’s I’ve values 200, 100 and 50 double in USAGE_TOT. Bubble stores these values only once…Do I miss something out here?

For setup of the API see: Datetime array from API not saved in database

Bubble by default doesn’t take doubles in lists (we’ll probably change that at some point), but in the meantime, the way users have solved that is by create a thing for each value and then two things with the same value aren’t considered as same, so can be in the same list.

okay, how do I create a new thing for each item in my API array? Do I have to make a loop to do a ‘create a new thing’ for each item in the array? I can’t find the option create new thingS

array: EXP_USAGE_TOT: [350,300,301,200,100,50,51,0,50,75,100,200]

Yeah it’s a bit tricky with the current system, today that’d be done with different calls but it’s not ideal. I’ll think about doubles in array but can’t change that overnight.

For those dealing with the same issue: a ‘workaround’ is to add a decimal to your numbers. On this way Bubble is seeing this as unique numbers. When displaying the data in for example a RG use the ‘:rounded to 0’ function.

It is not ideal, but it works for now!

array: EXP_USAGE_TOT: [350.00001,300.000002,301.00003,200.00004,100.00005,50.00006,51.00007,0.00008,50.00009,75.00010,100.00011,200.00012]

3 Likes

Hi @emmanuel, any idea when this issue is picked up by the dev team?

We’ve talked about it, it’s a major change to our database, so not an easy fix but a major project. We don’t have a timeline on this yet unfortunately.

Hi @emmanuel and @josh. Has there been any update to this? Facing the same problem

@eve

2 Likes