(JsonTextDecode) doesn't recognize leading zeros for comparison

This time I'm trying to get the label from a list of the first items.

From the label (prueba5)

image


Blue label: item number
Red label: tag

This number can have several leading zeros, for example:
sku, phone number, ID number, etc.

000133....

Example: In a text field, I type the number to get the item number and its content. Then I compare it with the text field; if they match, I get its label.

Use Do it, what do you see...

The value 00103 shows correctly in the spinner...

That dropdown menu shouldn't be visible to the user. It's only there for demonstration purposes.

Only the text field and the button should be visible.
In response, I need to get its label.

The logic would be:
If the content of the text field is within the dropdown list, I get its label.

What does your json decoded list look like then?

this is the list

No that is what you have on firebase.

What do you get when you use jsonDecode on those values ? (which is what you say the problem is)

Looks like you have AI2 lists stored under each tag. These should be returned directly as AI2 lists to the app.

This example makes it clearer:

When I type 100, I get its label 1000, OK.

When I type 101, I get its label 1001, OK.

When I type 0102, I don't get the label, but I do get the content of the label 1000.

What I need is to get the label of 0102, that is, the number 1002.

It seems I've set up the blocks incorrectly, but I don't know where.

Try this:

image

image

1 Like

thank you