A formula URL Button to check a box and Update a Date Field

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
  • (Edited)
Hi,

I am creating an application to track the progress of a customers onboarding. At the bottom of my form I have a button to check a box and mark the customer as successful or unsuccessfully onboarded. I have a Form rule set up so that when the checkbox is ticked - it updates a hidden date field, allowing me to calculate how long the process has taken.

I noticed when I check the box by clicking it, this works seamlessly, however when I check the box by clicking the button - the form rule does not seem to work and the date field does not update.

The end users will not see the checkbox, only the button.
Is there a way around this - potentially building in a function to the button that will update the date field with the current date?

Thanks for your help!


Current Button Formula:
If([Unsuccessful Onboarding Checkbox] = false,
    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=65m6uecaabu4w5qz7dbnim3jy" &
    "&_fid_72=1" &
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() &
        "?a=er&rid=" & [Record ID#]),

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=65m6uecaabu4w5qz7dbnim3jy" &
    "&_fid_72=0" &
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() &
        "?a=er&rid=" & [Record ID#]))
Photo of Ryan Wall

Ryan Wall

  • 102 Points 100 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of Slider

Slider

  • 1,326 Points 1k badge 2x thumb
Hello Ryan, 
Because you are using an api call to check the box, it will not trigger the condition for the form rule that is set to "when the condition becomes true". I am not recommending that you uncheck that setting. Lets modify the button. Replace ### with the field ID of the Date field.  This should set the date of Today in the date field. 

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=65m6uecaabu4w5qz7dbnim3jy" &
    "&_fid_72=1" &
    "&_fid_###=" & Today() &
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() &
        "?a=er&rid=" & [Record ID#]),

Let me know if this helps.

Photo of Ryan Wall

Ryan Wall

  • 102 Points 100 badge 2x thumb
Hey,

This has worked perfectly - just what I needed!
Thanks for your help!