Forum Discussion
QuickBaseCoachD
8 years agoQrew Captain
Yes this can be done.
The trick is the Key field of the Distance table needs to be changed to the same value in a formula field called [Related CF-Related Bin (formula)] set up such as
List("-", [Related Commercial Facility], [Related On Farm Bin])
But Quick Base won't let you make that a Key field unless you use a bit of an advanced technique using an API, so let me describe the low tech version.
Make a text Text field called [Related CF-Related Bin (key)]
So, one way to do this is to create that formula field and then using grid edit use copy and paste to copy the value in the formula field to the [Related CF-Related Bin (key)] field.
Then set the Key field of the Distance table to the [Related CF-Related Bin (key)] field.
Now, on your Loads table, make the same formula field
List("-", [Related Commercial Facility], [Related On Farm Bin])
... and using that field make a relationship to the Distances table to look up the value. You will find that the distance will populate automatically.
The last step is that if you ever need to add new Cfs or Bins, then you will need to have a form rule so that says
When [Related CF-Related Bin (formula)] is ot equal to [Related CF-Related Bin (key)]
Change the value of [Related CF-Related Bin (key)] to the value in the field [Related CF-Related Bin (formula)] and set that to fire all the time, so uncheck the checkbox at the very bottom of the form rule setup.
If you have a lot of distances and they get added to all the time with new CFs or new Bins, then theres in fact a way to change the Key field of the Distances table to be that formula field, so you would not need to have a form rule. That in many ways is simpler than this setup, but does require typing in a URL with an API to change the Key field.
The trick is the Key field of the Distance table needs to be changed to the same value in a formula field called [Related CF-Related Bin (formula)] set up such as
List("-", [Related Commercial Facility], [Related On Farm Bin])
But Quick Base won't let you make that a Key field unless you use a bit of an advanced technique using an API, so let me describe the low tech version.
Make a text Text field called [Related CF-Related Bin (key)]
So, one way to do this is to create that formula field and then using grid edit use copy and paste to copy the value in the formula field to the [Related CF-Related Bin (key)] field.
Then set the Key field of the Distance table to the [Related CF-Related Bin (key)] field.
Now, on your Loads table, make the same formula field
List("-", [Related Commercial Facility], [Related On Farm Bin])
... and using that field make a relationship to the Distances table to look up the value. You will find that the distance will populate automatically.
The last step is that if you ever need to add new Cfs or Bins, then you will need to have a form rule so that says
When [Related CF-Related Bin (formula)] is ot equal to [Related CF-Related Bin (key)]
Change the value of [Related CF-Related Bin (key)] to the value in the field [Related CF-Related Bin (formula)] and set that to fire all the time, so uncheck the checkbox at the very bottom of the form rule setup.
If you have a lot of distances and they get added to all the time with new CFs or new Bins, then theres in fact a way to change the Key field of the Distances table to be that formula field, so you would not need to have a form rule. That in many ways is simpler than this setup, but does require typing in a URL with an API to change the Key field.
- QuickBaseCoachD8 years agoQrew CaptainCorrection to the above as those are numeric field
List("-", ToText([Related Commercial Facility]), ToText([Related On Farm Bin]))