SHORT VERSION: I'm wondering if there's a way to temporarily store an array of data between the time a page loads and the time someone takes some other action on the page. I have about 35 things from a couple of sources other than AppMaker datasources, only some of which I need to load up front, but all of which I want to evaluate on action, and there's got to be a better way than creating 35 hidden fields on my page just to hold each data point.
LONG VERSION:
I'm working in App Maker on a tool to update employee information and keep it in sync among several sources. Those sources are:
The match point between the Admin Directory and the datasource is the Id -- the unique id from the Google user that stays intact even if a person's email address is changed. It's stored as a field in the datasource.
The match point between the third-party and the datasource is the employee email address.
The app user chooses an employee to update from a quasi-menu page with a Directory datasource picker, and then the EditEmployee page loads on select.
The onload action for the page triggers a script that loads just the fields from the Employees datasource that are on the page because they are things we want supervisors/HR to be able to update: Department, Title, Full-time status, etc. (There's a lot of other information in the Employees datasource that we don't want them to change directly, so we don't have visible fields for those items.)
The onload action also launches a server-side script that takes the stored Google Id from the Employees datasource, and looks up that user in the Admin Directory to get the organizational unit and a couple of other Google specific pieces of data.
I'd love to be able to hold onto all of the Google user data in the background, rather than to have to call AdminDirectory again whenever the action is taken. If there's a way to create an array that just hangs out waiting for that action in order for it to be referred to again, it opens up the ability to also look up the employee in the third-party tool once, instead of having to make multiple API calls.
Any ideas?
Ack! I'm a dummy!
The answer is custom properties at the page level.
I added a list custom property to my page, and in the onload script I created a string array out of the Google user data and set the property value to the array. I can pull back from that property in anytime I need to while I'm on the same page, until I clear it or reset the contents.