URL to manually refresh a connected table

  • 4
  • 3
  • Question
  • Updated 10 months ago
  • Acknowledged
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.
Photo of anthony3123

anthony3123

  • 134 Points 100 badge 2x thumb

Posted 2 years ago

  • 4
  • 3
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
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.
Photo of anthony3123

anthony3123

  • 134 Points 100 badge 2x thumb
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.
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.
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
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()})"
Photo of Stepan Gurov

Stepan Gurov

  • 220 Points 100 badge 2x thumb
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
Photo of JoJo DeSimone

JoJo DeSimone

  • 120 Points 100 badge 2x thumb
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
Photo of Keith Weber

Keith Weber

  • 60 Points
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.
(Edited)
Photo of Risp

Risp

  • 166 Points 100 badge 2x thumb
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..
Photo of QuickBase Girl

QuickBase Girl

  • 638 Points 500 badge 2x thumb
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?