[Solved] Joining text with a number to use as Airtable column name

I have some columns in my Airtable database. First of them is called “spr1”, the second is called “spr2”, the Nth is called “sprN”.
I need to access them easily, using one for/while structure. How do I do that? How do I convert a digit to text in Thunkable?

Thanks in advance!

If x = 1
Set label 1.text → “choice 1”
Else
Set label 1.text → “other choice”

Do you mean that you need to convert text to a number? I assume in Airtable you have text (e.g. “3”) and want to use it in a block that requires a number as input.

If not, can you explain how you intend to use the text version of the number?

The columns look like this.

As you can see, the first column is named “spr1”, the second is called “spr2” and so on.
If I try to access the cell from the 2nd row, 4th column like this it does not work, as A is not a character.
So I need to convert variable A, which is a number, to text.
numerge

How do I do that?

does this help?

could you rename your airtable columns to better work for you?

1 Like

I’m pretty sure you can just join “spr” with the digit 4 and access your column that way. But it sounds like maybe you’ve tried that?

Edit: this worked for me with an Airtable column named “spr4”:

Screen Shot 2020-03-10 at 8.16.43 PM

Edit #2: This also worked for me:

Screen Shot 2020-03-10 at 8.20.22 PM

Sorry, I got confused with your “name” variable and your “A” variable. But the process should work the way I’ve shared.

1 Like

You’re right. It works, but not for a FOR structure.

If I go through all the columns and try to edit all of them, it only edits the last one.

Can you post an updated screenshot of what you’re trying?

Yeah, I guess I’d need to see a screenshot, too. I did try this and it worked:

Screen Shot 2020-03-11 at 7.39.12 AM

Screen Shot 2020-03-11 at 7.39.20 AM

2 Likes

:diamond_shape_with_a_dot_inside:

This is what I got


after running this

Finally, solved it. The problem was that I had a purple block inside a purple block.
Thank you everybody for your help and patience!

3 Likes

Would you mind sharing your solution with us @hi1, just for the benefit of future Thunkers.

1 Like

Glad you figured it out!

I’ve changed the thread name to make it more relevant to the issue.

This is the solution. It worked for me.

1 Like