Forum Discussion

StevenDeYoe's avatar
StevenDeYoe
Qrew Trainee
7 years ago

Application Variable

Have a formula I would like in all 75 tables in my application.  I have tried making it an application variable, but when added to the tables, it only interprets the formula as text and does not display the result of the formula.  Is there an easy way to accomplish this without linking all 75 tables to a "settings/default" table that has the formula in it?

15 Replies

  • Just out of curiosity, what function does the formula serve where it would be practical on every application table. I'm just hoping to understand so I can venture a guess as to how to make this easier.
    • StevenDeYoe's avatar
      StevenDeYoe
      Qrew Trainee
      The function is to create a token for each table adding a level of security when writing or pulling data from that table via API.
  • A thought is that you can set the value of an application variable with an API.  API_SetDBvar

    Maybe push a button each day to set the updated value?
    • StevenDeYoe's avatar
      StevenDeYoe
      Qrew Trainee
      We're getting closer with this, but the variable is a token for us and would need to change at the exact time another site is changing that variable.  It works much like a handshake.
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      I assume the other site is issuing some type of token that is valid for a certain amount of time and you need to port that token over to QuickBase so you can make URL calls to that external service. Is this correct?

      By what mechanism does QuickBase become aware that the token issued from the other site has been issued or changed? Does the other site post to QuickBase or does Quick Base pull the token from the other site?
    • StevenDeYoe's avatar
      StevenDeYoe
      Qrew Trainee
      Yes!  The token changes with time stamps.  The other site looks at the token in QB and then checks its own database for the same token (also the same formula).
  • Application Variables always present themselves as "Text", so depending on the result the formula is meant to display, you would need to indicate the format in the Formula field you're using to call upon that app variable by name - for the following example we'll say your app variable name is "Variable"

    if you were to want to use this app wide variable on a form, you would need to use a formula type field, and in that formula you need to indicate the format the variable should result in, followed by the the variable name enclosed in brackets, just as you would when referencing any other field on that form.
    Ex. ToNumber([Variable])
    or ToText([Variable])
    or ToDate([Variable]) etc.

    Hope this helps, although I'm still really curious about your specific use-case for the app-wide formula variable.
  • So here is the formula I want in my app variable:

    ToText(Floor(Year(Today())/Day(Today())) & ToText(Day(Today()))&"9654"&ToText(Month(Today()))&"3546w")

    Ultimately, this: 100209654123546w would be displayed in a field in the table.  I want to be able to change that formula globally.  I suppose I could create variables for the parts in quotes and then change those, but would prefer to have the ability to change the whole formula for the entire application and all tables in one place.
  • Thank you to all respondents.  Please consider this question resolved.  Dan, thanks again for your guidance.  We will probably end up doing a variation of your suggestion.