# Using system.gui.conirm

**URL:** <https://forum.inductiveautomation.com/t/using-system-gui-conirm/60020>\
**Category:** General Discussion\
**Tags:** python, ignition80, perspective\
**Created:** [May 25, 2022, 5:15pm UTC](https://forum.inductiveautomation.com/t/using-system-gui-conirm/60020 "2022-05-25T17:15:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahawes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahawes/32/36337_2.png) [@ahawes](https://forum.inductiveautomation.com/u/ahawes)\
**Post date:** [May 25, 2022, 5:15pm UTC](https://forum.inductiveautomation.com/t/using-system-gui-conirm/60020/1 "2022-05-25T17:15:59Z")

</div>

Good afternoon all,

I am wanting to use the system.gui.confirm on a performed action. I cannot get it to work, says that I am missing attribute gui.

Please help.

```auto
def runAction(self, event):
	"""
	This event is fired when the 'action' of the component occurs.

	Arguments:
		self: A reference to the component that is invoking this function.
		event: An empty event object.
	"""
	data = self.getSibling("DateTimePicker").props.formattedValue
	category = "HMI"
	source = "ASCADA Client"
	usr = self.session.props.auth.user.id
	message = str(usr) + " Changed END OF SHIFT to " + str(data)
	data9 = usr 
	
	if system.gui.confirm("Are you sure you want to shutdown the plant?",
	"Really Shutdown?"):
		system.db.runNamedQuery("Tables/Change_Shift_Date",{
			"data": data
				})
				
			#Update Syslog		
	system.db.runNamedQuery("Tables/syslog_update",{
			"category": category,
			"source": source,
			"message": message,
			"data9": data9
				})
[details="Summary"]
This text will be hidden
[/details]

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/8/f8e44716ae070722cdc2b874ee6f6bb387558755.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 25, 2022, 5:35pm UTC](https://forum.inductiveautomation.com/t/using-system-gui-conirm/60020/2 "2022-05-25T17:35:29Z")

</div>

`system.gui` functions are Vision only.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [May 25, 2022, 5:40pm UTC](https://forum.inductiveautomation.com/t/using-system-gui-conirm/60020/3 "2022-05-25T17:40:59Z")

</div>

> [@Perspective - action confirmation dialog](https://forum.inductiveautomation.com/t/perspective-action-confirmation-dialog/24027):
>
> Is there any inbuilt way to provide an “are you sure?” type confirmation dialog before firing actions, like there is in the Vision module? I’m assuming that I can’t just use the same if system.gui.confirm('Are you sure?') script as vision - is there an equivalent way of achieving the same thing in perspective? I can make my own confirmation popup, of course, and pass parameters in and out to achieve what I want, but I thought there might be an inbuilt way to do it already.

---

<div class="post-metadata">

**Author:** ![ahawes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahawes/32/36337_2.png) [@ahawes](https://forum.inductiveautomation.com/u/ahawes)\
**Post date:** [May 25, 2022, 5:42pm UTC](https://forum.inductiveautomation.com/t/using-system-gui-conirm/60020/4 "2022-05-25T17:42:05Z")

</div>

Is there an alternative or is it easier to just code it?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 25, 2022, 5:45pm UTC](https://forum.inductiveautomation.com/t/using-system-gui-conirm/60020/5 "2022-05-25T17:45:26Z")

</div>

There’s no direct analogue. You’ll have to move to some kind of asynchronous replacement approach. For instance, open a popup view. Pass a message handler name or payload into the popup.  
In the popup, if the user confirms, broadcast a message.  
Then in the message handler, invoke your named query (in this case).  
There’s no support for a generic “invoke this callback” function approach (yet), unfortunately.

This _is_ an area where we plan to make some improvements, but no timeline.
