I’m having trouble accessing data I’ve placed in a list. When the user enters the system I use the Data API to get the records for all the clubs they are associated with and put those records into a list in App Data because I need to refer to it often.
I know the list is getting created correctly. My problem is ACCESSING the information. I can find no examples in the tutorials where multi variable arrays are discussed. (If you have one PLEASE let me know!)
Here’s an example of what I need to do: The User needs to select which club they want to create a new event for. So, I need to create a Select that contains the Club Name and objectID to an event is created for the correct club.
Hi,
if I understand everything correctly,
then you need to understand which club the user chose in order to create an event based on this data.
If this is so, then you can add the logic in the “On Page Enter” handler that you already have with “Set Options To Select”, a list of clubs will be displayed in your Select, then go to the handlers of the “Select” itself and in the “On Change Event” handler get the value that the user selected.
Hi Sergey -
I don’t think I explained it correctly. Yes, you understand. I need to create a Select that the user will pick from. My problem is filling the select with data. In your example the purple “Create List With” portion. All the rest is working just fine.
The data I need to read is in a list that contains multiple records that I read from the database upon application entry and store in App Data.
How do I access the data in this list? In my test data it has two items with data fields: ClubName, ClubContactName, objectId, and ownerId. I need to fill the select with the label ClubName and value objectId.
No. I’m talking about accessing a list I have created in App Data. It has two items (see the second picture in my original post). How do I get the ClubName and objectId data fields from the 2 items on that list?
I think it’s because my question is either very basic or something that maybe can’t be done. Though why you’d be allowed to create a list that has multiple data elements and then not be able to access the multiple data elements is a bit of a head scratcher.
I have a list with multiple items. Each item has the data elements ClubName, ClubContactName, objectId, and ownerId.
I need to create a Select from this list where the label is ClubName and the value is objectId.
How do I refer to the data elements on the list to create the select? (the purple part of my codeless in my original post)
LOL. I’m starting to think this can’t be done.
The list (myList, in your example) already exists and is kept in App Data so I have the information available for multiple pages.
Is it not possible to carry records from the database that are often referred to around in App Data so that API calls are minimized? I thought I read this was a best practice for minimizing API calls.
If it is possible to carry records in App Data - how do I manage moving them out of App Data so that I can do things with them, like creating Selects? I haven’t been able to find any tutorials or documentation on this topic. I figured I needed to use a list to do this, but maybe not. Given the struggles we are having on this thread.
OK. So, in order to use the information I have loaded in App Data I need to put it in Page Data using some custom code? What is that code?
Here let me state my problem more completely. Clearly I’m doing something wrong some place and it might not be obvious.
When the user first enters the system. I check to see if they are a club official. If so, the layout displays additional menus they need for event management. At that time I generate a list of the clubs they are authorized to manage events for and place that list in App Data for use on the event management pages.
In the On Layout Enter event I have the following code:
All good to this point. The list of clubs the user is authorized for now exists in in App Data where it can be referred to.
Now, they enter an Event Management page and need to select the Club they want to work with so that the events associated with that club are then presented for selection.
This is where I get stuck. I need to pull that list out of App Data and create a Select using it.
What I currently have doesn’t work. Since there are only two actions, I am either (1) getting the data from App Data incorrectly (or in a way where it can’t be referred to) OR (2) setting up the data in the Select incorrectly (referring to the data wrong).
From your previous reply it appears I am getting the data from App Data incorrectly (1). And I need to instead use some Custom Code to place the data into Page Data. What is that code?
And how did you get it into the puzzle piece format? The only codeless piece I can find for Custom Code looks like this:
THANK YOU. I truly appreciate the time you are spending on this.
Do you hear that? That’s choirs of angels singing your praises. Thank You.
Can you spare the time to explain why this didn’t work? Was I deconstructing the list into it’s component parts? Which would explain why I was getting a length of 12 (a count of all the individual data elements) rather than 2 (a count of the number of records from the database) when I originally coded it. I just tacked the unexpected result up to - “Well, I didn’t understand how that works.” Rather than “There’s a problem here.”
The “Load Table objects” block always returns a list. Even if you put pageSize 1, it still will return a list of one.
What you had in your logic was wrapping the entire list of the Club records into another list. The final list was a list of one element, which in turn was a list of objects. And that sent the rest of the logic downhill to crash…
OK. I’m having another problem. Sorry. I thought I had this figured out. But lists are confounding me.
I have my list of clubs the user is authorized to manage in App Data. Now, I need to build a list of the events all those clubs are having to create, yes, another Select.
I’m trying different things to get the ClubNumber data element out of the list in App Data to build the WHERE clause to get the Event records. I’m running out of ideas. This is what I’ve tried, all are giving me an empty list.
The complete set of logic: (because, yes, I can learn.)
Well. I’ve found lots of ways this doesn’t work and am once, again out of ideas - even with your wonderful hint. At this point, I’m simply trying to print out the WHERE clause. Once I nail that I’m pretty confident the rest will work.
My first thought was Ah-Ha! this is what is meant! Nope. Undefined.
What if I create a new object? Like how the Select was formed… Though why I’d need to create a new Object when presumably one already exists is a puzzle. But stranger things… Nope. Failed.
I’m out of things to try. There is something fundamental here I don’t understand. I really wish your tutorials discussed lists that have data elements (properties).