Discussions

Expand all | Collapse all

Problem with UserToken in Formula URL

  • 1.  Problem with UserToken in Formula URL

    Posted 11-23-2017 16:12
    I have a working Formula URL button which is changing the value in a checkbox, based on the current value.  However, we're having problems with another user's use of the button to trigger a quickbase action (the related records won't update).  Through some discussion with Quickbase support, they believe that I need to add a user token to the formula.  I have the user token created, but I'm not sure how to add it to the formula URL.  This is the current formula:

    // make a formula variable to be the opposite of the checkbox condition.
    var bool NewValue = not [Process for Submission] ;


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

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


  • 2.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 16:36
    Would it not be the apptoken instead??  Something like this ??

    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_9=" &apptoken=apptoken& URLEncode($NewValue);


  • 3.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 16:37
    Try this

    // make a formula variable to be the opposite of the checkbox condition.
    var bool NewValue = not [Process for Submission] ;


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

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


  • 4.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 16:58
    great thank you.  That worked (for the button), but it still didn't fix the problem with the Quickbase action


  • 5.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 17:04
    The Quick Base Action should continue to operate under the Permission of the user who created the action.

    I suggest that you check if the "other User" actually has permission to update that record.

     One way to do that is to change the URL button to this - ie temporarily comment out the javascript refresh as that hides the error messages.




    // make a formula variable to be the opposite of the checkbox condition.
    var bool NewValue = not [Process for Submission] ;


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

    $URL

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



    That will expose any error messages when the button is pushed.  My guess is that the "other user will push the button and get some kind of permissions error.


  • 6.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 17:33
    I know that the users have permission to update both records.  The actual records in the other table would already have been updated by these users (and they have), and the checkbox value is changing when the user clicks the button, so I believe the permissions are okay.  I also just tried changing the users role to Administrator (same as my role) in the most recent test and the results are the same.  I'll comment out based on your suggestion and report back


  • 7.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 18:02
    No errors on the update (and that's validated because the checkbox value always changes), it's just that with this user the QB Action doesn't fire. 


  • 8.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 18:24
    Well that has me stumped.


  • 9.  RE: Problem with UserToken in Formula URL

    Posted 11-23-2017 18:29
    Same as the QB support tech I spoke with.  I think he was taking shots in the dark to try and resolve it.  


  • 10.  RE: Problem with UserToken in Formula URL

    Posted 10-18-2018 12:38
    what is the trigger field and more importantly what field types are you populating?