Discussions

 View Only
Expand all | Collapse all

URL to manually refresh a connected table

QuickBaseCoach Dev./Training

QuickBaseCoach Dev./Training07-18-2017 21:05

  • 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

    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 09-01-2020 09:17
    Hi Matthew,

    A very good alternative approach.

    This Approach does not show the errors .--> as its a button.

    If I want to show the errors to Non-Admin users, Is there a way to show errors after the Sync run.

    ------------------------------
    Vivek Vishwanath
    Hyderabad, India
    +91 8185868789
    ------------------------------



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

    Posted 05-28-2021 11:31
    Is anyone aware of a good way to configure this in a webhook, as QB is phasing out JS?

    ------------------------------
    E. P.
    ------------------------------



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

    Posted 02-08-2022 12:49
    For webhook please see my response at this post:

    https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=aeaf08cb-3f79-4d60-a5ea-540b2015222c&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer

    Thank you

    ------------------------------
    Razi D.
    Desta Tech LLC
    razi@destatechs.com
    ------------------------------



  • 6.  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.


  • 7.  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.


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

    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()})"


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

    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.


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

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


  • 11.  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);"


  • 12.  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?


  • 13.  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()})
    ?


  • 14.  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


  • 15.  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


  • 16.  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.


  • 17.  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..


  • 18.  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?


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

    Posted 03-18-2020 18:19
    This is incredible!  Thanks.  I'm trying to combine this code with the formula to update the linked record in the connected table.  I have both the buttons working independently, but I'm not sure how to combine them.  The goal is for someone to be able to initiate an edit of the record in the connected table with a button and then have the refresh occur automatically so that they can see that updated value.

    Is there a way to combine this refresh code to execute after something like the code I below?

    var text URL = URLRoot() & "db/<CONNECTED TABLE ID>" & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_231=" & ToDate(Now())
    & "&apptoken=XXXXXX";

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

    ------------------------------
    Tate Forgey
    ------------------------------



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

    Posted 03-18-2020 18:21
    Tate, I don't think there is a way for a nonAdmin to click a button to cause the Connected Sync table to refresh.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



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

    Posted 03-19-2020 10:12
    It is possible but I was surprised it worked. As a post above mentioned the role needs to have the ability to delete in that table and suddenly they can refresh it via this link. They do not see the actual button though so I had to create one for them.

    I've made a code page and embedded it into a users dashboard and this allowed them to refresh the connected table via my created buttons while not being an admin. I didn't have to do anything crazy, I did a simple post to https://myRealm.quickbase.com/qb/sync/refreshTasks?replicationID="+repID and then  checked the response. If the response included currentRefresh.status that was anything other than 2, it failed in some fashion. If it was a 2 then the refresh worked. I also disable the button after they click it to prevent them from spam clicking.


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

    Posted 04-04-2020 01:07
    Thanks for all this great info! The code "javascript:$.post('https://myrealm.quickbase.com/qb/sync/refreshTasks?replicationID=xxxxx')" within a formula URL field works with Chrome; however, it fails to work in FIrefox. When clicked on in Firefox, I end up getting a page that simply says "[object Object]". What am I doing wrong?

    ------------------------------
    Patrick Dunn
    ------------------------------