Ok, its my turn to get help with this. None of the posts seem to provide the precise syntax to make this work and I have tried and tested at least a dozen permutations with no success.
The issue.
I am creating an email body using HTML for nice format AND I want a hyperlink text to click on and open a specific Form in the app. I have this working just fine and the HTML code is below.
The problem is that when the link is clicked it shows a blank form BUT when I close the web page (on desktop) and re-click the link, then the Form opens with the expected data.
I can wait 15 minutes (or longer), AFTER getting the email, and still have this issue in spite of the fact that the opening of the app indicates it is performing a Sync. I suspect that an up-to-date Sync is NOT truly being performed.
I want to try adding the force Sync to my hyperlink to see if it fixes this issue. I know others have done this and it seemed to correct the problem.
However, my attempts to get a syntactically correct HTML coded hyperlink are failing. Please tell me what I need to do to get the coded link below updated to add the force sync parameter - &at=NOW()+1.
A portion of My HTML Code Hyperlink - this adds a hyperlink to the email and opens the correct Form
How can I add "&at=NOW()+1"? I have been getting message like "= is unexpected token - expected;" or "cannot start with &", and others
...
<a href="https://www.appsheet.com/start/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
<<LINKTOROW([_THISROW],Practitioners_Form)>>">Adjust this record</a>
...
I'm sorry but actually this is a problem that AppSheet has when dealing with HTML Entities inside some parameters or attributes and the only way I've been able to deal with them is by using some Javascript that makes this URL after AppSheet parses the template and adds the data.
I was working on this with @Phil but sadly it seems he is no longer part of the AppSheet Team, one of the biggest losses I'm aware of ☹️.
I don't recall (because I moved to the javascript trick) if making this URL somewhere inside the app and then just referencing the column that holds the URL works or not, but that might be your last option because Javascript inside an email is not an option
I maybe just made a new discovery about this whole force sync parameter thing. I think the whole thing with the "NOW()+1" is maybe completely unnecessary. It seems like all you need to do is put "&at=x" at the end of any appsheet URL to cause a sync, and the "x" can be anything, including a literal "x".
2023-2-13 EDIT: I've just discovered that the above does not work for all platforms. "&at=x" will force a sync when using the app within Firefox, but not on mobile, and not on Chrome. So, don't use that, use the full thing
"&at=" & ENCODEURL( NOW()+1 )
Btw, can you try doing this?:
<a href="https://www.appsheet.com/start/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
<<ENCODEURL(LINKTOROW([_THISROW],Practitioners_Form)&"&at="&NOW()+1)>>">Adjust this record</a>
I think I tried that too but I will try again. Maybe I wasn't tilting my head just right at the time! 😜
Ok, I tried. Below is the changed code and the subsequent error message:
<a href="https://www.appsheet.com/start/ddac6e74-cba2-4144-9e9d-f397b1bf0dd5
<<ENCODEURL(LINKTOROW([_THISROW],Practitioners_Form)&"&at="&NOW()+1)>>">Adjust this record</a>
The error:
Thanks to those who have replied.
I have tried all manners of adjusting the implemented HTML and simply cannot find a way to get it to accept the force sync parameter.
SO...I backed completely off using HTML and implemented a straight app link that includes the force sync parameter with no hyperlink.
The data still does not load on first attempt. I have to close the page and re-click the link. AND the same issue is occuring on the mobile device.
The resulting email link looks like this:
https://www.appsheet.com/start/xxxxxxxx-cba2-4144-xxxx-f397b1bfxxxx#control=Practitioners_Form&row=5...
I am opening a new post just on this.
🤔 I imagine there's something with "sync-on-start" getting in the way
"Sync on Start" is ON.
I have confirmed that if I simply switch the link to opening the Detail View instead of the Form View directly, then I have no issue whatsoever. So, I'll probably keep it this way but it would be nice to know why I can't go to the From View on the first attempt.
@WillowMobileSys wrote:
it would be nice to know why I can't go to the From View on the first attempt
---------------------------------------------------------------------------------------------------------------
Anyways, I just noticed this inside the URL of one of the apps that I 'previewed in full screen'
It had this "refresh=1" bit I've not noticed before
@MultiTech wrote:
maybe it's because you're going to a form? And you can't sync inside a form?
But I can get into the Form on the second attempt. The thing is that I can confirm the new row IS in the app by navigating to other app areas. This is AFTER the blank Form is loaded and before any additional Syncs have occurred. So, I am less inclined to think that this is a Sync issue.
@MultiTech wrote:
It had this "refresh=1" bit I've not noticed before
Hmm, I do remember Aleksi mentioning that parameter in one of his posts a long time ago. Forgot all about it. I can give it a try. Maybe there is a difference between the Sync and the Browser cache being refreshed?
User | Count |
---|---|
15 | |
10 | |
7 | |
3 | |
2 |