Refresh query binding on session custom property

Good morning, I have a custom property with a named query binding on it.

This query return the user settings. I have a page where I can update these settings.

I wonder how I can force the refresh of this query when the save button is clicked without maybe setting the polling rate.

Thank you

1 Like

I believe you should be able to use self.session.refreshBinding('custom.your_prop').

3 Likes

Good morning, as Pascal noted you can refresh bindings at will, but to get up to the session prop from your button take a look at message handling:

A Session level message handler that uses self.refreshBinding() is the common solution. This can work across sessions to refresh different sets of users, or if targeting just the immediate user you could skip a lot of the message handling entirely see Pascal's comment.

You can achieve similar behavior with more custom props and change scripts too: add a different session custom property that is like a switch, have the button conclude by "flipping" the switch, and then on the change script of that new switch custom property you can refresh binding. Using a memory tag as the switch can be a quick way for a universal refresh.

2 Likes

Thank you all for the help and for the suggestions. I confirm that this method works

self.session.refreshBinding('custom.your_prop')