Schedule a Webhook for a future date based on a field value

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
The basic webhook that I have used so far is:
"After a record is added to Table A, create a record in Table B".

What I want to do is very similar to this but on a delay.  I want to say:
"After a record is added to Table A, create a record in Table B on <effective date>."

Effective date is a field in Table A and I want the Webhook to be triggered by the record add, but not make any changes to Table B before that effective date.

I didn't see any built in options for this and couldn't find anything related in the community.  Any ideas?
Photo of Richard Pfister

Richard Pfister

  • 584 Points 500 badge 2x thumb
  • challenged

Posted 2 years ago

  • 0
  • 1
Photo of Richard Pfister

Richard Pfister

  • 584 Points 500 badge 2x thumb
Does anybody have any suggestions here?  I have a really hacky workaround in mind but would love to hear from others if they have anything slicker.

Current plan:
  • Webhook1: after a record is added to Table A, if the effective date is <= today(), create a record in Table B (final destination).
  • Webhook2: after a record is added to Table A, if the effective date is > today(), create a record in Table C (interim table).
  • Schedule QuNect to transfer data from Table C to Table D daily at 5am, triggering subsequent Webhooks.
  • Webhook3: after a record is added to Table D (by QuNect), if the date is = today, create a record in Table B
Step 3 just seems really awkward, stepping out of the QuickBase software just to schedule an action.
Photo of Jacob

Jacob

  • 758 Points 500 badge 2x thumb
How about just making table B a connected table and filter only the records where the effective date is on or after today.  You could then set it to refresh every hour.  Then only the records that have an effective date past today will pull into that table.  There are cons to using a connected table but this seems simpler than managing four tables.
Photo of Richard Pfister

Richard Pfister

  • 584 Points 500 badge 2x thumb
That's brilliant!  But will that checkbox change without user interaction?  If the record on Table 1 is created Monday with an effective date of Friday and nobody touches the record again, will the checkbox update itself?
Photo of Richard Pfister

Richard Pfister

  • 584 Points 500 badge 2x thumb
And to give you some context: I want people to submit changes to our Roster as soon as they are aware of them, future-dated as often as possible...but I don't want someone's July-1 retirement being reflected as actual on the Roster until that date comes around or they will show as inactive when they're not (they could lose building access, systems access etc. too early).  So I've built separate tables and forms for different request types to be fed to the Roster when they become effective.
(Edited)
Photo of Jacob

Jacob

  • 758 Points 500 badge 2x thumb
First: I believe the formula box should work without interaction but you can test it to be certain. 

Second: Basically you have a roster table (users) and these users are submitting requests to change a field on that table from say active to retired?  However that field needs to reflect that they are retiring on July 1st not today.  Am I close?
(Edited)
Photo of Jacob

Jacob

  • 758 Points 500 badge 2x thumb
Could you just make this rosters status field (active, retired, etc) a formula field and default it to active.  Then have the users edit a new field called future status field which is a multi-choice select where they can select a future status like retired or inactive.  Pair that with a required date field.  Then your formula field will be something like If(Today() is after the date field show [Future Status Field] if not show active.
Photo of Richard Pfister

Richard Pfister

  • 584 Points 500 badge 2x thumb
The challenge with this approach is that I have 31 fields on the roster, the retirement date/status is just one example.  So I should probably give the full context.
The roster contains everything from seat number, to name, to User ID, to active status.  The managers can submit anything from a simple seat change to a brand new hire to a termination.  I've got separate forms (and tables) for new hires, terms and data updates.  The data update form shows every field of existing data from the roster in a formula field and then presents the same fields in an editable format: the manager can change any or all of these fields as needed.
The tables serve as a change log, while the forms allow the managers to interact in more user friendly way and also allows me to control their inputs with required fields.
I cannot have the forms they submit feed immediately to a live Master Roster, but I want it to feed when the effective date of the request becomes active.
I think your approach would work, but I don't think we could have more than 1 future-dated action per person.
Photo of Richard Pfister

Richard Pfister

  • 584 Points 500 badge 2x thumb
Jacob - Thank you very much for your ideas and help on this challenge.  I have a working solution using the connected tables that you suggested.  The checkbox updates itself, the connected table is refreshed hourly and I am using webhooks to add, delete and edit records on the master roster.
Photo of Jacob

Jacob

  • 758 Points 500 badge 2x thumb
Great!  Glad to hear my suggestion in working.  It seems simpler than four or five tables and Qunect.  The beauty of Quick Base is that there are many ways to solve for the same problem.  Glad you found a solution.