Quick Base Discussions

Expand all | Collapse all

Is it possible to fire web hook on click of Button ?

  • 1.  Is it possible to fire web hook on click of Button ?

    Posted 04-13-2017 22:00
    I have a button(Formula URL) and I want to fire Web Hook that I have created in my table. Is it possible to fire it on click.


  • 2.  RE: Is it possible to fire web hook on click of Button ?

    Posted 04-13-2017 22:12
    If you make a URL formula button toggle a checkbox field, then, then you can trigger the Webhook off a change in that field.  Post back if you need help building the button.


  • 3.  RE: Is it possible to fire web hook on click of Button ?

    Posted 02-19-2018 10:34
    Hi There, can you maybe assist with showing us how to build that button? Can this web hook be used with multiple conditions?


  • 4.  RE: Is it possible to fire web hook on click of Button ?

    Posted 02-19-2018 14:18
    Here is an example of a URL formula button which simply Toggles a checkbox field between true and false


    var bool NewValue = not [Checkbox Field]; // this makes the NewValue the opposite condition of the checkbox current value


    var text URL =
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_55=" & URLEncode($NewValue);

    "javascript:" &
    "$.get('" &
    $URL &
    "',function(){" &
    "location.reload(true);" &
    "});" & "void(0);"


    // the above presumes that the field ID for the checkbox field is fid 55.


  • 5.  RE: Is it possible to fire web hook on click of Button ?

    Posted 02-19-2018 14:19
    Note also that an Action is way way easier to use than a Webhook, so if you have a choice between an Action and a Webhook, use an Action.  An Action is limited to just Adding records or editing records.


  • 6.  RE: Is it possible to fire web hook on click of Button ?

    Top
    Contributor
    Posted 02-19-2018 14:24
    FWIW, the void(0) part is not necessary because you are navigation away from the current page:
    var text URL =
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_55=" & URLEncode($NewValue);
    "javascript:" &
    "$.get('" &
    $URL &
    "',function(){location.reload(true)})"