Save empty in firebase

I need to save a list of 5 dropdowns maintaining the item order

but when the dropdown is empty I don't want to save anything

image

I tried this but nothing
image

any ideas?

if sp1.selection is empty, and sp2 is not empty, like "4", and you save it as [4].
When you retrieve the data back, how do you know this 4 is for sp1 or sp2?

1 Like

Are all five items the same type?

If one is missing would it cause confusion with the other items?

You could send a json string to Firebase, which would identify which "SP" the data was related to...

{"SP_1":4,"SP_3":7}

then parse this to a list on return.

I have a restriction so that it saves if it contains text in any of the dropdowns, otherwise it does not save

There are 5 elements to select

doesn't cause a problem
Only after saving and getting that list in another dropdown it appears as empty to select

image

image

If I could save this way

{"SP_1":A,"SP_2":B}

could
get only A,B in a dropdown?

any example?

There are plenty, and we have probably shown you most of them already.

Get the values from the json, set them to a list, and set the list to a spinner's elements

Search the board for "multiselect".

I managed to save empty but as text within a list

The only detail is that I can't insert "," between the items
any suggestions?
Untitled

these are my blocks

When I add the symbols this happens to me

image

You could try this:

image

I get error

It seems there is something wrong with:
when any spinner. after selecting

I need to get this to save to FB.
image

If item 3,4,5 was not selected, nothing should be saved
attached .aia
xxxx.aia (5.2 KB)

Your ElementsFromString should look like this:

image

Spinner1 for Spinner1, Spinner2 for Spinner2, Spinner3 for Spinner3, etc.

something is wrong, I copied all the blocks you sent me and this message appears

The joined list in Label1 does not appear either
only {} appears
image

You could try it in the aia. What do I attach to you?

I will have another look at your aia.

Your copying mistake:

image

sorry for the mistake
but it's still not what I'm looking for

image
fb
image


The spinners must be empty when starting
If it does not contain text it should not be saved in the list

It should be the same when saving
image
fb
image

Do you need to know from which spinner the items were picked, so that they can be returned there when getting values from Firebase ?

You might save yourself a lot of time and effort by using this, with checkboxes:

I forgot about the conditionals
long but reliable