Sometimes you might want to view a step by step history of actions performed on some Knack database record. For example, a process that has several steps, you might want to capture when/who/what type of things for each stage of the process. This video will show you how to set that up. It's pretty easy with Knack.
If you are a fan of building great apps with Knack, please click the Subscribe button to join my channel, and ring the bell to receive notices on all my new instructional videos. Thanks!
hey folks uh Dave Parish here at KnackBuilders uh doing another video if you like these videos I'd ask if you uh like them on YouTube and subscribe to theYouTube channel butuh today's topic how to keep a history log of uh of your records now what I mean by this I'm gonna give an example it's very useful I use it all the time this is a school that I'm doing a lot of work for and this is someone's application okay a parent creates an account they add their kid and then they have the kit apply for something some school to get into there's a whole long complicated process of it but I'm and we track a lot of history meaning actions that happen to that application it's a whole process that goes on but I'll give you one example to put it clear status history we want to know what that app what that application is going through and where it is now uh and if weever have an issue with a parent too this allows us to point directly to it and say hey this is what happened on this date blah blah so here's an example on this date at this time an application was created that means they're working on it then the parentssubmitted it here's the parent and thensomeone at the school does what call itverification it says who did it uh timeand date in this case they did theverification they checked it out andsaid yeah this kid has been selected togo to the school and then the final stephere is it's been selected and theparent back to the parent has acceptedit so now the kids going to be in a rowthat's what I'm talking about and uhit's pretty easy to set up it shouldn'tbe too long it's just it's a process youcan do or a setup on anything so let'sgo for it I'll be back in a minuteokay I'm back let's jump into how to setup uh an action track history loghere's what you do I'm going to go tothe data side firsthere's our table of applications this isall information we need for applicationsI'm not going to get into thatbut to that we're going to have childrecords going to create you can callthese whatever you want this is a statushistory that's the one we're going to bedealing with today you can call itstatus log we have one for emails thatare sent out user has ability to tocommunicate with the parent and thenit's captured in a log of your emaila number of things but let's here's whatyou do applications is the parentstatus history as a child so we're goingto make the connection uh the connectingfield in the child record I shouldalmost always should status historywe're grabbing time date automaticallywe're doing a user this is who performedthe action it could be a processor atthe school or it could be aparent and look what we do it's what wedo is to accountit's usually best when you're captionedwho did something to do it to accountbecause that captures any user roleit can get messy if you have a number ofdifferent user roles in your and you'reconnecting with each one of those that'sa whole other topic but do it to accountit's easiest and it always catches it uhand then we're grabbing some otherrelated stuff the school this this grabgoes to the application it grabs andputs it in natively sometimes it's niceto have it natively on a child recordyou can always go up to the parentrecord and grab this when you're doing auh anything a report a a tablewhen it's grabbing uh what you'll seeit's just grabbing a handful of stuffthat's useful to know to see how thatapplication is flowing through theprocess so here's again put theconnection to the applicationumin the status history now let's go tothe pages side I'm going to do thisthat's not itlet's goback here sorry about thisPages sideright here application detailsthis doesn't matter I don't need to showyou how to navigate this let's have itrender herecome on let's go nextdown here right here these are variousthings update status this page I showedyou before where the statuses are thisis where it is here so this is adepartment processor they got handed anapplication via the system here and theygot to go do stuff to it and this whatthey first do is this verificationprocess then and I'm not going to getinto that workflow but here's when it'stime to update the statusumthey goto the details of that this is that formthese are all these various statuses butlet's and all they have to do is Selectitlet's go to the rulesthat's what we're going to deal withrulesrecord rulesso when they do thisthey insert the key is insert aconnected record this is a really usefulinsert a connected record in this casetwothat table status history this is achild tableyou know months to grab this variableinformation it's grabbing the dateum it's grabbing whoever performed thisaction the logged in account that's areally useful thing in all kinds of waysit's grabbing the status and putting init in this connected record so whateverthey selectum it's moving it to thatand let's grab the parent because I wantit in there nativelynow I'm going to put on the side hereyou know I guess it's possible someonecould open this formumand not change anything and submit itagainespecially when you're doing we'redealing with thousands of applicationssomehow that could happenI didn't actually deal with thatsituation we haven't had a problem but Ibelieve you could do thisright here this is a nice thing if we goto application statusand we're going to say has changednotice that you can use this in a lot ofplacesso if someone were tosubmit this form with the with the samestatus because they just click throughit or click happy has changed this willprevent this from creating a log thatreally didn't need to exist and even ifit did exist you could tell just bylooking at it that's what happenedbecause there'd be two Logs withdifferent dates and same status butthat's what you do that's about it thisis gonna this can be I just did this foruh a government organization that fundsuh the promotion of Commodities beanspotatoes whatever there's a bunch ofdifferent groupsand they have longuh approval processand they also get this money for thegovernment and they have to they getaudited all the time they have to keepthem real good they call it audit Trailwho did what who approved this and whatthey blah blah all through the processand we do this here too we just everytime something happens it captures whatwe need to know when who did it what anduh so when they get on it they can pointright to it instead of beforegoing through files spreadsheetsliterally paper too so that's all I gottoday folks I appreciate it thanks