Open Modal on page load if recordset criteria is met

I have three recordsets that contain dates. What I want to do is show a modal on page load if any of the three recordsets contain a date prior to current date.

This doesn't seem possible. Has anyone done anything similiar? Any help would be appreciated.

Thanks :beers:

Hi Brad

Have you tried putting it in the App Load or Ready? I’ve not tried it but that would be the first way I would have a go.

Can you not just use a flow triggered by the success event of the connection and then use conditional logic in the flow to open it?

If they are separate SCs just conditionally set variable and open if

If variable is not set (saves it being opened twice)
AND
Condition is true

Open modal

Thanks Jon, that works for opening the modal on page load fine but I need a condition added.

That makes sense but where is the set value step? I don’t see that any where?

Hi Brad,

I believe Brian is referring to the Set Value step - to set value for a variable such as var_modal_open at the beginning of the page flow.

Yeah, I don't see a set value step option though?

It is available as an Action when you add a Run step.

1 Like

Just define a variable say varOpen (or a toggle) on your page and set it's value to 0

On the success event of your 3 server connects, using a flow

Firstly test varOpen is zero (indicating the condition has not yet been met)
If it is non zero the condition has been met and the modal will have been opened.

If zero then use a condition to check if the data complies with the necessary condition
If not do nothing.
Otherwise the big one, test for the required data condition.
If it is true AND varOpen is zero, open the modal and set varOpen to 1
If data condition is not satisfied do nothing.

I would have shown this with Wappler example but on phone.

Its a simple wappler solution once the logic is understood.
Any questions please ask.

3 Likes