You can create and configure a client-side storage data resource with a schema matching that of the result given by the API call. Then write the result of the call to the storage resource. You’ll then be able to load up the resource anywhere in the app and use the data stored there. Basically, you’re caching the data. I haven’t got a clue about any storage limits, so do test it.
Hi @David_Diamond, a data variable makes an API all every 5000ms by default, so I would suggest you remove the delay logic after successful “Get record collection” on the Logic canvas if you decide to use one:
Another way to do this is to create a “List of Objects” type app variable that matches the schema of the list coming in from your API. Then when the app launches, get the data with a Get record collection node on the Global canvas page, and set the app variable to its output value.
The benefit of this method over using a data variable is that while the data variable will only be accessible on one page of the app, you can access an app variable anywhere.
I do disconnect that loop for the data variables where it’s not needed. I hadn’t tried the app variable idea, mainly because I was too lazy to recreate the entire schema manually, and I wasn’t sure that was a good solution. But I’ll give it a try now.
Is there something different about App variables that prevent them from working with various functions? I’ve created the app variable, and I’m able to reference the items from a list. But when I click into the list to open a details page, I can’t for the life of me figure out how to reference a given object within the App variable. I’ve tried FIND, LOOKUP, INDEX-OF, etc. They all complain about a type mismatch between objects and lists.
I want to be able to pull values from the clicked list item record on the previous page. I just can’t figure out why this isn’t working for me.
Do you need to call the API to retrieve the data every time your app launches? In that case, you should try Mari’s approach and use an app variable within your Global Canvas which you use to store the results from the API call. On the other hand, if your data doesn’t change and you only need to load it once, it’s best to save it into client-side storage. You can then retrieve anywhere in the app where you place your data variable. You’d still need to make sure both schema match though.
There are two ways to do this: either set parameters into your details page which you pass from the list item you’re clicking (I don’t like this because unfortunately parameters can only be text types, and thus they are quite annoying to work with if you have non-text data), or you pass an id parameter to your details page and then filter the element with that id within your list using something like FIND_BY_KEY.
What I’m trying to do is get a list of objects based on a field value of those objects.
In the attached image, if I do a FIND BY KEY on “id” it works. But I need to find all records whose Region field (for example) holds a given value. I’m trying to reference the field by its key, and also via “fields.Office”, but neither works. Appgyver shows me a complete path to the field, but it includes , which I’m guessing is restricting the search to that index item.
I’m sorry this is so confusing. Chances are, if I knew how to ask in a way that wasn’t confusing, I’d probably be able to figure out what’s wrong.
"Hi David_Diamond, a data variable makes an API all every 5000ms by default, so I would suggest you remove the delay logic after successful “Get record collection” on the Logic canvas if you decide to use one…"
Figured that one out the hard way when we blew through 10,000-15,000 API calls in one day just having a single user’s profile page open. So are you saying, if we remove the delay, then it’ll only make the call once when the page is loaded? That makes sense. I was just under the impression the delay component is slowing down the call rate – and that without it, it would call several times a second or so.
So we actually used a longer delay (say, two minutes) to save on calls. But if we can just remove it and have it fire once on page load, that would be even better. Thanks!