Checking value from firebase and indexing

I am creating like a queueing system so I need to make the index inorder from the firebase db. I want first to check from the firebase if this current queue number is taken then the current num will be indexed to +1 =2 then it goes on until the value and the current num is not equal. Do you have any block suggestions? ![:dizzy_face:|16x16]

blocks progress

firebase db

I steered you away from them before, but this might be one situation where using Firebase Arrays could work for you?

1 Like

I think I have already seen these in the past days but this time is instead of indexing from the tag, I need to place them as values of a tag (queue_number). However, I think this suggestion will also work by making testid1 as queue_number instead of creating it inside. Thank you, I will test it first though.

Also if possible what tag you are using to get value from fb men it will be convenient to suggest any blocks

I couldn't skip the zeroes, Its a bad practice to start from zero in a queue algo since I also need to fetch them after they've taken their number.


*testid1 is auto generated using posttext.

since there is two mobile communicating to this db, the user/client side need his queue num and the shop name after booking a queue line.(black)

on the other side needed by the a client side to manage queue is the queue number and user name. (red)

my blocks is kinda messed up rn for both project :skull:

Before posting or bookQ, i need to check first the index of queue so what I did is I used firebase to check its currentIndex then the result should return a queue_number that should not be the same with the current queue_number in the db.

Just add 1 in your app :wink:

1 Like

May be you can try like this..

Call tag list of queue db and count it. Then set index number to +1

Can you show me the blocks you used?.