Perspective: Buttons to set session custom property

Not sure if this is obvious… but I have below where I want to be able to select an item from the dropdown menu which is bound to a session custom property. However, I also want to allow the user to use the two left/right buttons to set the session property as well, where it would essentially set it to the next/previous item in the dropdown menu list and wrap around at the ends. I know how to do this in Vision, but Perspective scripts run on the gateway hence can’t be used here… Not sure how else to do it?

I may end up doing this slightly differently and using the carousel component instead, but I’m still interested in the solution otherwise.

Edit: Turns out the scripting option worked… I guess magic happens that passes in the session id and hence i’m able to modify client session props despite not being able to run the script locally on the client?

Yes. Perspective event scripts, while they run on the gateway, run in a thread context that has access to the session.

2 Likes