Error with "in list find first occurrence of" block

Today I have encountered one of the most frustrating errors yet…

I have isolated the error to the below code blocks:

This should look for the integer “56400” in a list, if it finds it, it should call out the position of that number in that list.

Expected result: My debug label should read something like “56400 - 107881, 73000, 56400, , , , - 3”

Instead I get this:

Despite 56400 being RIGHT THERE in the list, it cannot seem to find it.

I’ve been grappling with this all morning. I tried to recreate it in another app and it worked perfectly so I really hope I have just done something stupid here and someone will (gently) point this out to me!

The first entry looks like it is “56400 - 107881”, not “56400”. It has to be a perfect match.

Hi Briani, thanks for the response. The first entry is in fact “56400” - look at the blocks.

The reason for the " - " is that I have set the label to display the entry it is searching for followed by the " - ", followed by the list, followed by the number of ties it has found that entry.

1 Like

You’re right. You need to compare text to text. You’re comparing a number to a text string. Join the 56400 number to an empty string (“”) to convert it to a text string when assigning it to the variable. Even though it makes sense to our brains, 56400 ≠ “56400”.

This worked, thanks tatiang!

1 Like