Accessing list data between components

Hi,

I am creating a list in the page logic which holds the letters of the alphabet and I want to make that list available to other components on the page.

Not sure if this is the correct method for lists.

I then have a slider that I want to use as a selector for the letters and a text box which shows which letter has been selected. So in the slider logic, I have this but when I run it I get an error that Alphabet2 is undefined.

Would appreciate any help.

Thanks
Steve

Have you tried debugging the logic to see what values are actually there? For example, when you use the print block, it will output its value into the Console tab of the browser’s DevTools panel.

Yes, I did - this is what I get

Steve

I am not sure where you put that “print” block, so, unfortunately, it doesn’t tell me anything.

Is there any data for the Alphabet property in Page Data?

Hi,

The On Change Event is for the slider (logic shown above). If I have only the first set block enable, and do a print on Alphabet2, I get an empty array.

When I enable the second set block, I get an response of undefined.

APP ID is 4F8308C4-61AE-488A-8E12-F7C47377AAF4, Default Container, landing page if you want to see first hand.

Thanks as always,

Steve

Have you checked if there is any data for the Alphabet property in Page Data when inside of the On Change Event handler?

So I did this for the Page logic and get an array on the print command

For the slider, the On Change Logic was amended -

and I get undefined in the console.

Try moving the logic that sets up the Alphabet property in Page Data into the “On Before Page Enter”

No change

Hopefully, this explains the problem:

When you assign (or read) a value in PageData (or any other data model/object), you have to reference properties as strings. In your case you reference a property by providing an empty list. That doesn’t make sense and will not work.

Ok, got it. Used just the word Alphabet and now the array on the slider logic.

Now to figure out how to change the property result to a list so that I can search it.

Thanks

1 Like