If statement based on field ID

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • In Progress
I want to do an if statement based on a field ID and the field ID number should be a value from a different field.

Like:

If(_fid_[field that has the ID I want to base on]>=1,true,false)

Thanks
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
Formulas work on field names, not field IDs.  They adjust automatically if you change the field name.

IF([my field]>1, true)
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
I understand that is the standard. I was wondering if there is anyway to base it on the field id.

Thanks for your reply
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,954 Points 20k badge 2x thumb
You can do this:
[_fid_6]
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
Well, live and learn. Is there ever a benefit such syntax.
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
The only benefit I can see is, if I can implement it in a way where the field ID number can be looked up in another field. This will make things much more dynamic.

Let's see if Dan can come up with something.

I tried declaring a var by putting:

var text fid = "[" & "_fid_" & [field that has the ID I want to base on] & "]";

but when I put fid in the syntex its taking it as a text instead of a field id indicator...
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
Thanks Dan,

I am trying to put instead of [_fid_6] I want to replace the 6 with a field that has the value of the field id number....

Can this be done via script?

Like:  [_fid_[field that has the ID I want to base on]]

Thanks again
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,954 Points 20k badge 2x thumb
Case([fid],
  6, [_fid_6],
  7, [_fid_7],
  8, [_fid_8],
  9, [_fid_9]
)
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
Thats a good idea but still does not make it fully open since you still need to hard code each field ID

Thanks for the idea.