thisRow() always returns text - loses type

Hey,
Using “thisRow” seems to always give you text, even if the column you refer to contains a number.
ie its doesn’t seem to give you the “type” of data in the row, meaning you have to convert it back to whatever type it is.
Is this a bug or am I missing something?
Ian

Hi @Ian_T :blush: !

thisRow alone doesn’t return a value per se… it returns the row reference of this specific row in the table (and uses as a display, the value in the field you selected as Display column in your table) :blush:.

thisRow being a row, stores behind the scene, all the values in the various fields you might have in your table for this very specific row.

If you need a value stored behind the row reference thisRow to use it somewhere else, you can simply access (dereference) the appropriate value by appending .[Name of the field where the value is stored] to thisRow.

Which would look like this in its entirety :smiling_face: :

thisRow.[Name of the field where the value is stored]

Here’s a small sample to illustrate :blush:

You’ll see 3 fields:

  1. Name a number field which is also the Display column of my table
  2. thisRow a text field with the simple formula: thisRow

You’ll see that the formula editor with small visual cues/hints will tell you that thisRow outputs a row (nothing else, it’s a row).

  1. thisRow.Name: a number field where I’ve accessed (dereferenced) the value stored in the field Name for thisRow using the formula : thisRow.Name :blush:

You’ll see that this time, the formula editor will tell you (still with visual cues/hints) that thisRow.Name outputs a number (as the value within the field Name is a number stored in a Number type of field) :blush: .

I hope this helps :innocent:

2 Likes

Thanks for taking the time!
I think issue was that the thisRow().column…gave me some text even though the column type was a number.

Hi @Ian_T :blush: !

Without more context I can only guess that you used thisRow.[Some Number] in a formula outputting a text value, maybe ? :thinking:

Formulas tend to expect an input of a certain type but they also output a value of a certain type.

So, depending on the formula you used, thisRow.[Some Number] was potentially converted into a text value during the process…

This is just pure speculation :innocent:

This actually solved another problem I was having and had no way of explaining so thank you!

1 Like

My pleasure @Bradley_Skaggs :smile: !

Thanks for letting me know this helped you to overcome your issue :grin: !
It’s really appreciated :smiling_face: !

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.