[Method] Close Perspective Popup from tagUpdate event

I have a scenario where I have an dialog that when a button within it clicked, it fires off a library script function that updates a tag. That tag then remove items from another dataset tag. Currently I have the dialog closing when the library script function finishes.

My issue is that secondary tag update takes a few seconds to update in Perspective. So until that tag updates it looks like nothing has happened. My thought was to move closing the dialog until after the tag is updated but I'm not sure how to accomplish that. I have thought about using the tag binding I have to to that dataset that shows data in perspective to do this but I need to know the previous state so I know when the dataset was decreased to close the dialog.

Does anyone have idea's on how I could accomplish this? I hope I have explained well enough.

Create a custom prop on your popup view bound to the dataset tag, then close the popup in a value change script on the prop value

1 Like