How to Force a Sync || AppSheet Explained

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
greetings salutations and all good things in between what's up everyone matt here i guarantee at some point in the future when you're building your app sheet app you'll get to a point to where you'll want to take the information that your user has entered and immediately push that into the cloud in this video i'm going to show you how you can do it let's do it so i have a sample app here that i'm going to release put on my profile i'll put a link down below that i'm going to use to demonstrate how this works it's built off of the alternative order capture sample app that i built before if you want to see how that was made check the link up above so the idea that i've got with this app right is i've got an order that i'm building i can add products to it this that whatever that i want to do and then i can click this completion button to mark this order as complete okay so what i want to do is i want to take over that button when somebody pushes that complete button i want all of this sort of information to be pushed to the cloud because maybe you know like it it just it didn't happen as fast as i needed to but i want to get it out immediately so what do i do okay well this action is already in action and so if i just go and i find it right this little check box is this check mark here and so what i got to do is i need to change this so this action is the actual thing that changes the order status to complete what i really need to do is i need to change that action that's visible from the actual action that makes the change to a group action that way i can throw another thing inside it so what i'll do is i'll copy this and then change this to a stack status complete right and then so the do this becomes grouped execute a sequence of actions and then what i want to do is i want to take that original action this one and put it in that stack but first what i'll do is i'll kind of clean up this original action so i got to hide this we don't need to see it anymore so like i'll get rid of this i'll make this do not display i'll turn off this confirmation i will also remove this uh you could leave that in i guess if you want it doesn't matter it doesn't hurt anything to leave it there the important thing to do though is to do not display your original action that does whatever it was doing and then take that and put that inside your stack action that you've made so that it changes it so it does the thing that you originally told it to do it does that first now what we're going to do is we're going to throw another action into the mix this is really the mean potatoes and the key that makes everything work so in order to force a sink there's a little bit of code that you throw at the end of any deep link formula so those link to row or link to view those formulas that you use to kind of take your user somewhere else in your in your app you can throw a little bit of code at the end of that that it tells the system that when it goes to that place it needs to make sure everything's updated so let's first figure out where we want to go um so like i'm here in this building order view and when i press this complete button then um where do i want to be taken like where do i want the user to go that's the first thing that you've got to figure out so you know i could drop them on the product table if i go back to my ux i can show you so i've got this building in this new so this new one's a form so i don't want to drop them to there the thing that i think i will do is i will drop them into the detail view of the order that they just made but i it can't be this view because this is only for the building orders so i've got to go to the regular detail view for the order table so i'll just come down here find my order details right this is the root view and i'll just copy the name of it and now we go make the action so back in behavior make a new action it lives on the order table the original place where i needed to execute and so this is i'm going to call sync and this would be order complete right and the do this is i want to go to another view within this app and the target is a link to row because i'm trying to view this order in that view just like that so this is your traditional deep link formula where i say i want to view this record in that view right okay so the thing that you do to make all of this forcing type stuff work is you throw a little bit of code right at the end of this right here and i will throw this code into the description down below so that you can copy it and i highly suggest that you put it into your snippets if you have the app sheet training dot com sidebar uh and yeah so you see with this little bit of code here this and at and now whatever that is all that it takes to cause the system to force sync and so i'll save this i'll kind of clean up this i don't need to see this i like to use this little tweet thing for that and then i'm gonna so i'm done with this and i stick that inside my stack after the original action that i had so when i push this button now what happens is that it first thing it does is it changes the status of the order to complete that does the actual thing that i needed it to do right and then it syncs the order it takes me to view the record that i was just that i just completed in a different view right but when i go to that view it's updating the data so if i save all of this now and we go back and we test this you can see what this looks like so i'm over here on the building order right and maybe i add in a few more things so that i've got those stacked up and i hit go there we go so immediately the app starts syncing the data and it's pushed to the cloud this is a fantastic way where you can completely avoid a whole bunch of problems of like people not uploading their data users are terrible about pushing that sync button they will finish doing what they do and maybe if they're on a mobile device they'll close the app they won't even think about pushing the sync button and getting that stuff to the cloud or if they're on uh like they're using the web browser they do the same thing they finish what they're doing cool done close the brow close the tab unfortunately those sinks need to get into the cloud by using this technique where you throw that little bit of code at the end it immediately starts the sync process which taps into some pavlovian things that we as humans who exist in the 21st century have been conditioned all our lives for what i'm talking about here is a progress bar all of our lives we have been exposed to various progress bars and we now know that we generally need to wait for these progress bars to finish and so when you force a sink like that and it causes that little progress bar to appear you're tapping into the psychology of of of people where they'll see the progress bar go oh i need to wait for this and they'll wait for it to finish and then when it's done then they'll close the app so this is a fantastic way that you can avoid a whole bunch of problems it's really simple it just takes that one little bit of code that you gotta throw inside this little bit right here and like i said i'll throw that down in the description below i hope this has been educational for you i hope it's helped you i do appreciate it thank you for stopping by see in the community [Music] you
Info
Channel: MultiTech Visions
Views: 5,160
Rating: undefined out of 5
Keywords: AppSheet, MultiTech Visions, DIY, Mobile App, Development, Citizen Developer, No-Code, Low-Code, training, how to, walkthrough, tutorial, software development, advanced techniques, open source, tips and tricks
Id: 3BQ_xVnalm4
Channel Id: undefined
Length: 9min 2sec (542 seconds)
Published: Sat May 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.