This might be a case for using component. Depends on what you’re showing.
But no, if its not saved anywhere, you can’t access it. The case for a component is that the component itself loads the data, and the component is the only thing using the data. (Saved to a component variable)
Yes, I believe that the collection is the correct way to go but I cannot figure out how to retrieve only 1 record. I asked this in another thread but haven’t has any responses as yet.
I am trying to get the last inserted record and don’t want to pull all the data and then to filter in the front end for performance and security purposes.
Sure, there’s a couple of ways to goal here, depending on how your pages are set up and when you’re getting this information. Here are some suggestions.
Let’s say, you have create a thing then navigate to thing details.
You can add a collection called current_thingfiltered by id = 123. id is defined by for example query param. ie. .com/details?id=123.
Or you can have a component that SELECT and stores the data in its own variable. You would run this component action on page load, or on mount, or whenever it suits you.
Or.. Let’s say you have a list of things, then you want to **create a new thing and add it to the list.
**
You have a collection called things, and a action that insert a thing into database. You can check the toggle to “return inserted row", then in the workflow Update collection to add the newly inserted data to the collection (without calling backend one more time).
I don’t know exactly what you’re trying to achieve but I hope some of these methods give you some pointers!
I am gathering information on Page 1, storing to a table on Submit and navigating to page 2. Once on page 2, I want to display some of the information including a row id that would have been created on saving to the table.
What I wanted to do with the collection was to retrieve a single record sorted by created_at desc.
Based on your suggestion, I used the Return Inserted Row option and that worked.