Update firebase item

I would like to update only item number 1 in the red circle

image

One way is to obtain all the items in its label and save it again, but it becomes very extensive and heavy.

I would just like to update item 1
from 30 to 15

without touching item2


some example?

Hello,

I think it is not possible. You need to get the data stored in "2", then replace the first item of the list, and store it again in FB.

You can use the web component and the PATCH block to do this.

image

Do you have any example?

from:

In the case you propose, you would need to update the entire list in the value for the tag 2.

In which case you can just use the firebase blocks to do this.

(I have advised you several times about storing lists to tags, instead of using firebase as it is supposed to be used, with a tag structure for each value...)

This example is when I have a fixed item to change, for example, where would I put the number of the item to change?

what I'm looking for is that
After selecting the item you can change it

For that, I will already know what item number it is and I will change it for the moment. I have 2 items there but it can be extended to more items.

image

image

you cannot change only one item of the list stored under the tag "2". You have to update the whole list with the new value for the first item. You can do it with web component (patch) or with firebase blocks.

But I would consider TIM's advice on modifying the data schema to make it easier to modify each element

Also, storing data like this:

image

using tags 0,1,2... will create a Firebase Array, which will not behave in the same way as when you use alpha-numeric tags (e.g. 0000, 0001,0002,0003 ...)

1 Like