How to save firebase realtime data base tags using sequential numbers such as 001, then 002 and so on?

How to save firebase realtime data base tags using sequential numbers such as 001, then 002 and so on?

Before saving a new entry, you need to find the last used tag to determine the next sequential number.
Use the FirebaseDB component’s GetTagList block to get all the existing tags under a particular node. This will return a list of all tags.

Once you have the list of tags, you can sort it and find the last tag (the one with the highest number).
Extract the numeric part of the last tag and convert it to an integer.Increment this number by 1 to generate the next tag.
If the tag number is less than three digits, format it with leading zeros (e.g., 001, 002).
Use the new tag to save the data to Firebase with the StoreValue block.

When Button1.Click
FirebaseDB1.GetTagListOn GotTagList:When FirebaseDB1.GotTagList (tags)
if length of list tags > 0
    set lastTag to select list item (list = tags, index = length of list tags)
    set tagNumber to text segment (text = lastTag, start = 1, length = 3)
    set nextTag to (convert tagNumber to number) + 1
    set newTag to join text (text1 = if nextTag < 10 then "00" else if nextTag < 100 then "0" else "", text2 = nextTag)
else
    set newTag to "001"
FirebaseDB1.StoreValue (tag = newTag, value = yourData)

Can you help me to display the block in Kodular? sorry I’m a beginner