Discussions

Expand all | Collapse all

URL to manually refresh a connected table

  • 1.  URL to manually refresh a connected table

    Posted 07-17-2017 05:13
    Is anyone aware of method for non-admin to manually refresh a connected (gmail) table?

    I have a gmail connected table with minimum refresh time (one hour). Sometimes we are aware of an email from customer but have to wait up to an hour to sync to table before we can work on it - difficult to explain to a customer.

    The 'Refresh Data' button seems to only appear for admin, hoping there is a URL to trigger a refresh.

    Cheers,
    Anthony.


  • 2.  RE: URL to manually refresh a connected table

    Top
    Contributor
    Posted 07-18-2017 03:56
    You can initiate the refresh with a url similar to this:

    https://mydomain.quickbase.com/qb/sync/refreshTasks?replicationID=12345

    The trick is knowing your replication ID.  You will need, as the admin, monitor your network traffic during a manual refresh, and pull out the ReplicationID.  

    Then you should be able to add a button for everybody to refresh the data.


  • 3.  RE: URL to manually refresh a connected table

    Posted 07-18-2017 04:24
    Hi Matthew,

    Thanks for your reply.

    By inspecting the  'refresh data' element I get a replication-id=25948



    The URL I construct is http://muif.quickbase.com/qb/sync/refreshTasks?replicationID=25948

    The response is 'no such operation'

    Have I formed the URL incorrectly? 

    Regards,
    Anthony.


  • 4.  RE: URL to manually refresh a connected table

    Posted 07-18-2017 18:11
    I'm very curious about this one too .... i tried to make that URL after looking at the source code of the page to obtain the ReplicationID and received the same error.


  • 5.  RE: URL to manually refresh a connected table

    Top
    Contributor
    Posted 07-18-2017 19:43
    Sorry for the mix up. 

    Because URLs are naturally a GET request (to pull information from the server), but the refresh is a server side action.  We need to use a POST to initiate the refresh.

    So your formula URL button would be:


    "javascript:$.post('https://mydomain.quickbase.com/qb/sync/refreshTasks?replicationID=12345').then(function(res,code) {console.log(res,code);window.location.reload()})"


  • 6.  RE: URL to manually refresh a connected table

    Top
    Contributor
    Posted 07-18-2017 19:44
    Keep in mind that sometimes the refresh action on the server takes longer than the refresh action in the browser.  So you might have to manually refresh the browser after a bit to see the updated information.


  • 7.  RE: URL to manually refresh a connected table

    Posted 07-18-2017 21:05
    Thx Matthew, much appreciated Community Contribution.


  • 8.  RE: URL to manually refresh a connected table

    Posted 07-18-2017 23:16
    Thanks Matthew, I can confirm your solution works perfectly!

    I have implemented using the following formula URL button:

    "javascript:$.post('https://mydomain.quickbase.com/qb/sync/refreshTasks?replicationID=12345', function(){location.reload(true);}); void(0);"


  • 9.  RE: URL to manually refresh a connected table

    Posted 08-10-2017 12:45
    Hi, how can i run this script outside quickbase? Like an external HTML file?


  • 10.  RE: URL to manually refresh a connected table

    Posted 11-26-2017 14:29
    Thanks a lot for advise. It works!
    Just three questions:
    1. Am I right, that after sending two consecutive Post commands for refreshing two separate tables the second will terminate the first one? Is there a way to somehow divide them so they won't interfere?
    2.Is there a way to somehow check that refresh have been completed so it could be read programmatically?
    3. Could you please also shortly explain what is the purpose of the ending of script input:
    .then(function(res,code) {console.log(res,code);window.location.reload()})
    ?


  • 11.  RE: URL to manually refresh a connected table

    Posted 11-26-2017 16:19
    Well, Matthew Neil | CirrusOps, nevermind, i've made it miself :)

    Looks like "window.location.reload" just reloading the page after the Post request have been processed.
    So I've replaced "window.location.reload" with "window.location.href = 'some url' " to force browser to navigate to other page and then just repeatedly checking if this page is already loaded (I'm operating from VBA macro so only little straight JS methods works for me :)
    After the page is on - I just send the next refresh request


  • 12.  RE: URL to manually refresh a connected table

    Posted 12-08-2017 16:43
    Hi, I set this up as detailed and it works for admin users however I get the following error when using the URL with a non admin user.  If anyone else seeing this error in the sync history  or is there something setup incorrectly?  We are using an SFTP connection

    There was a problem refreshing the table. Refresh started by Kevin Reese was unable to start. The error was Quick Base application XXXXXXXXXXXXX not found for user YYYYYYYY


  • 13.  RE: URL to manually refresh a connected table

    Posted 07-27-2018 22:09
    I have the same error as JoJo when trying this solution.  The URL works for my Administrator account for not for any other person.  It works if I "Test as" them or their role however.

    Edit:  For anyone else having the same issue that JoJo and myself had I found the issue to be that the user clicking the Refresh URL needs to have delete rights in that table for their assigned role.  I had not given delete rights since the user couldn't actually delete the sync'd projects anyway.


  • 14.  RE: URL to manually refresh a connected table

    Posted 09-04-2018 19:11
    Does anyone have a sample code to accomplish this in Python 2?  I'm new to working with Web data and this would save me some research time...  

    Thanks,

    I'll Post when/if I get his working in Python..


  • 15.  RE: URL to manually refresh a connected table

    Posted 09-20-2018 18:00
    So color me derp, but I am looking to refresh the two child tables under the parent table. Button is on the parent table. How might I do this?