Activating a Modal Screen programatically

I have a modal screen that opens fine with button code as below:
pict2

I would like to get the modal screen to open programatically. I am using the code as below:

This does not work.

How should I do this?

Mike

1 Like

Hey @mdsmith1,

I think the method you're looking for is modalFrame5.setHidden(false) (documentation here).

In all honesty, I do think modal.show and modal.hide are a bit confusing and they should work. However I've never used them and it seems setHidden is the way to go.

1 Like

Hey Mike, can you confirm where you are running this code. This seems to be within a SQL query which would not have access to the retool js context?

2 Likes

Hi Miguel;

Unfortunately modalFrame5.setHidden(false) generates an error message.

I looked at the documentation and I can't find a better way of doing this.

Mike