Need help understanding the usage of the "force sync" parameter

My use case is an action button that navigates to another app using LINKTOVIEW().

Navigation works beautifully and when exercising the button in the editor a Sync is even is performed when transitioning to the second app. Perfect! Exactly what I want.

However, when testing from the browser or a mobile device, the Sync is NOT performed. So, I need to introduce a forced Sync.

The widely published way to force a Sync is to add this parameter to the navigation link:

..."&at=", ENCODEURL(NOW()+1)

Using a CONCATENATE() to add the force Sync, my expression looks like this:

CONCATENATE(LINKTOVIEW(ANY(SELECT(Apps[Return View], [App ID] = [_THISROW].[App ID])), [App ID]),  "&at=", ENCODEURL(NOW()+1))

This results in the link text looking like that in the image below:

Looks good to me and works great from the editor! However, when the button is tapped from either a browser view or a mobile device - no Sync is performed!!

I did try replacing โ€œ&atโ€ with โ€œ#atโ€. A Sync IS performed. On the browser the Sync is performed TWICE then navigates to the refreshed app as expected. On a mobile device, a Sync IS performed and it looks like the app is opening refreshed but then it immediately goes to a blank white screen. I have to close AppSheet completely and re-open to recover.

What am I missing to get the navigation to perform a Sync?

1 20 856
20 REPLIES 20

MultiTech
Participant V

Try simply leaving that pound sign in the deeplink - does that interfere with the sync happening on the app editor? If not, seems like the hashtag is needed and that might fix things.

I did try with โ€œ#atโ€ and while it performs a Sync, it doesnโ€™t behave correctly. Browser version Syncs twice and then is ok. The biggest problem is that, although the mobile version Syncs, it leaves the app displayed as a blank white screen - no menu, no buttons, absolutely nothing but white!!

Also, by introducing the โ€œ#atโ€, that means the โ€œ#โ€ is in the URL twice. I believe thatโ€™s incorrect syntax but not completely certain.

That would be an error/issue, the double of the hash, yes.

@WillowMobileSystems have you reached out to support yet, I would - this looks like a bug.

Then againโ€ฆ now that I think about it:

  • I just ran an app, in a browser, with a forced sync action and it worked.

Testing my phoneโ€ฆ

  • Indeed it worked there too.

So thereโ€™s something funky going on. If you want, you can share your app and Iโ€™ll have a look.

Can you share the expression, or suedo-expression, that you used so I can compare?

And was this a link to navigate between Apps?

It was a regular deeplink expression with the force-sync code at the end.

I see that you are not encoding the DateTime. Is that not necessary? Maybe its interfering with the force sync? Iโ€™ll try without the ENCODEURL() function.

Could be - no, I just tag that little bit on the end of any deeplink to get it to sync.

  • LinktoView
  • LinkToRow

@Bahbus. @MultiTech_Visions

Ok, I had a chance to play a little more with the โ€œforce syncโ€ capability and here is what I know.

Editor - It doesnโ€™t seem to matter whether you have the โ€œ&at=โ€ parameter attached or not, when navigating to another app a Sync is performed.

Browser and Mobile - If I try to navigate to another app with the โ€œ&at=โ€ parameter, no Sync is performed. If I simply change the view to one within the same app - no other changes to the action - a Sunc is executed. See images below.

Iโ€™m not sure if this is a bug or not but will open it to support for their input.


Action to go to another app - Force Sync does not happen

Action to go to another app - BUT use view in same app - Force Sync DOES occur

The &at= URL parameter will be interpreted at the targetโ€™s end, not at the originโ€™s. Therefore, when using it to navigate to a different app, I would not expect a sync to happen before leaving the current app.

I am not quite sure what I said to give this impression. I want the Sync to happen in the targeted App.

I have raised this to support and they are looking at it.

Oh, well since youโ€™re changing apps AND you want the freshest version of it, try using refresh=1 as explained here:

Now that you mentioned it, I do recall mention of this before. My impression was that this only works in browsers but Iโ€™ll give it a go and see what happens!

Seems like this might be the key really; the problem weโ€™re fighting here is the fact that the app โ€œremembersโ€ where you were - wonโ€™t this wipe-thing solve that?

@WillowMobileSystems Iโ€™m curious to hear the results of this.

I guess it depends. Sure, it remembers where you were. But if youโ€™re demanding a specific location within said app refreshed, I doubt it would be needed. But I am curious as to see the results of each one and both together.

So far nothing is resolving the issue. AppSheet support is looking at this as well. Here is what I know.

The โ€œrefreshโ€ and โ€œwipeโ€ did not work - for either mobile or browser. I tried โ€œrefreshโ€ first and then added โ€œwipeโ€. Just for grins, I also tried adding the โ€œ&at=โ€ parameter. No Sync.

One interesting thing I realized. When I navigate from App1 to App2, a Sync happens EVERY time without a forced Sync. It is the navigation back to App1 where I am having the trouble.

So I tried to identify the differences in the transitions. When I transition from App1 to App2, I use a LINKTOFORM(). I tried implementing a LINKTOFORM() to go back to App1, no difference in Sync behavior.

Before transitioning to App2, I am locking down all the tables in App1 to be READ ONLY - which is why I need the Sync to open the table back up again due to changes made. So, I thought maybe the locking down of the tables was preventing the Sync. I removed that code from all of the tables and tried the navigation again - still no Sync.

My next effort will be to try what AppSheet is doing, create a couple of new apps and try simple navigation between them to see if I can re-create it. I suspect that I will.

Thanks for keeping us all posted. 3X_d_5_d51363a862e7ab883241c312ac5d7f271579cdd3.gif

I created two very simple apps each having a button to navigate to the other. The very first transition on a mobile device performs a Sync (without the force ). Each transition after that simply shows the โ€œStarting upโ€ message and goes straight into the app. No additional changes were able to force a Sync.

The ONLY time I could get the โ€œSyncing appโ€ message was if I used โ€œ#at=โ€ instead of โ€œ&at=โ€. On a mobile device, the app acts as if itโ€™s syncing then goes to a completely white screen - no visual app properties at all - only the line with the time, battery % and signal strength.

Using โ€œ#at=โ€ in the browser, the Sync is performed twice and then enters the app as normal. I guess its making up for the failed Sync on mobile.

Its in AppSheetโ€™s hands now!

Iโ€™m happy to report that Syncing seems to be happening now when transitioning from App2 back to App1. Yeah!!

Bahbus
Participant V

Iโ€™ve been having issues with the browser in general refusing to get the latest version of the app. It just merrily assumes everything is the same. Doesnโ€™t check for updates on launch. Doesnโ€™t respect starting screen. It just grabs the cached version from however long ago until I forcefully sync it to get all the changes.

I believe this is related to the update that โ€œresumesโ€ the last state of the app, instead of just forcing the users to the start screen - which I preferred.

Bahbus
Participant V

I donโ€™t ever do any app juggling, so to speak, but I would agree with @Steveโ€™s expectationโ€ฆ Itโ€™s a go here and sync. Not a sync and then go here.

Top Labels in this Space