How to show modal when variable is empty

Hi, I have a Modal that I’d like to show when a variable is empty.

I also need it to open when triggered manually so I have a variable set for that.

The behaviour I’m seeing is that in my app, if I log in, then exit and come back later, I’m still authenticated but the data needs to be fetched again. The app won’t know what data needs to be fetched unless the user selects it, because they can have multiple versions of the data in their account. This happens in a modal.

So I need the modal to show when that data is blank, and also when the data is there but the modal is manually triggered to open (this would happen when the user wants to switch their data to another version)

This is what I’m currently doing but without success.Any help would be greatly appreciated.

Screenshot 2023-09-18 at 2.06.30 PM

Without checking in editor, I think this should work.
Its possible the currentLinchpin variable’s default value is an empty object/value such as {} so it might not recognize it as ‘false’. If you set it to completely empty, then it might behave as you expect.

If not, then maybe doings keys(currentLinchpin).length might help, but its a bit of a hack :smiley:

If the variable is undefined then you can do !variable
What type is it? Object? Text?

Thanks I’ll give that a try, the variable is an Object.

Either change it to a boolean, or aim for it’s property. In JavaScript an object is never false, even if empty.
So either do

[modalObject].open, dont forget to set it back then!
Or change it to a bool.