Forum Discussion

NCLeeIV's avatar
NCLeeIV
Qrew Member
5 months ago

"Button" Data Refresh Quirk

I'm working on a Formula - Rich Text field ([Reject]) that creates a clickable "Reject" button as part of an Expense Report app. The goal is for a user to be able to type notes into a form and then click Reject to trigger other actions via API calls. It's pretty much a variation on the (awesome) Magic Buttons app's "20A. Edit record then add record then display record" field.

The first issue I encountered was that the button wouldn't "know" the latest value of the [Notes] Text field that's being edited since it hasn't been saved/persisted to QB yet. A workaround for that was a [Current Notes] Formula-Text field with a formula of just [Notes]. Since it's a formula, it gets updated every time the user updates the [Notes] field.

With that problem solved, the button almost works... Except there's a catch: If the user enters notes and -immediately- clicks the Reject button, then the formulas don't get refreshed before [Reject]'s current <a> link gets followed. This means the API calls don't have the latest [Current Notes] value. I've tried Form Rules for updating field values, but that didn't seem to help. Any other user action, like pressing tab, enter, clicking somewhere on the form, or even holding down left click for a second or two, causes the formulas to refresh and the button works A-OK.

Has anyone else encountered this behavior and/or know of a way to force formulas to be refreshed? 

  • The challenges that QuickBase behave similar to Excel. In both cases, the software doesn't see the change in the cell or the field until you tab out of it.  

    One workaround would be to create a checkbox field, which when checked, would show your reject button.  That would force the user to tab out of the field. Then you could have a form rule to uncheck the checkbox when the record was saved.

  • DonLarson's avatar
    DonLarson
    Qrew Commander

    The way to solve this is to track every change in the Expense Report Status.   Here is an architecture that will do what you want.

    By having the Expense Status Change Table in between the Expense Report and the Expense Report Status, you can enter your notes about the Status Change there.   Separately you may have some sort of Report Note in the Expense Report Table that the employee can enter.

    The secret here is the second relationship between the Expense Report and Expense Report Status Change. 

    1. You make a Summary Field in Expense Report for the Maximum Record ID of the child table Expense Report Status Change.
    2. Make the 2nd relationship between Expense Status Change and Expense Report where the Expense Report is the CHILD and the reference field is the field Max RID Expense Report Status Change.
    3. Now the very last status entered becomes a Look Up field back in the Expense Report in that relationship.
    4. When the Reject Status Change is saved, you can fire Pipelines, API calls or any other variety of integrations that you need and the Note of the person who rejected it is available.