How to Close message box activity automatically?

I have selected options as Yes / No in message box, and used IF condition based on the inputs, if no inputs to message box then it should continue with default values. how to do that? how to add timeOut to messagebox or how to close automatically?

@nadim.warsi Hi brother any suggestions on this?
Any one know how to close message box if no inputs?

Hi @manju1992

The closest activity to what you have described is the AutoCloseMessageBox that you can find under manage packages (search for vvaidya.autoclosemessagebox.activities) like the image below

After that customize the properties

Regards,
Reda

1 Like

a simple way would be to add delay and then add a click activity to close the message box, should work!

1 Like

this activity doesn’t consist Yes/No options, this works just as popup…

adding delay or click activity works only when message box activity finish its operation.

So what you want to do exactly ? maybe you can check after delay that input variable is Null or empty then close the message box, would it solve your problem ?

1 Like

problem is:
Consider the below one as sequence which consist 3 activities

  1. message box activity (Yes/No)
  2. If activity (Then and Else)
  3. take any activity : ex. Log message
    I have inserted a message box(1) which consist Yes/NO options.
    If user clicks yes, it falls in IF_Then(2) condition and do operations
    if user clicks No, it falls in IF_Else(2) condition and do operations
    If user not clicks any one of the buttons (Yes and No) then it should wait for 5-10sec, and move to next activity(3) which comes after IF activity…

Best turnaround will be to create an extra boolean variable to check if the input is provided by user or not, to avoid no input (your actual problem) use the delay and close and if the input is not obtained then mark the boolean value as false, put your actual if inside ‘Then’ of another if, and check the boolean value to true.

So if the input is provided, boolean value is true and your if activity is executed, if no input your message box is closed with boolean value set to false and the nested-if will be skipped and it will be moved to next activity.

1 Like

Sure…Let me try this…thank you so much:slightly_smiling_face:

used delay but how to close message box activity? as message box activity (X mark) is disable, cannot use click activity to close it

try kill process, or set click on ‘yes’ or ‘no’ button and clear the variable to make it an empty value.

test.xaml (12.5 KB)

Added workflow, please check this, and if any changes, update it and send it back. Thank you.

Hi @manju1992,

Try using Callout Activity

Regards
Srish

1 Like

See here: https://www.uipath.com/activities-guide/callout

I believe the link is:

Please can any one use callout after or before messgae box and use yes&no option and try to solve my problem…i have tried several times couldn’t find result. Please share it back… Thank you.

Hi @manju1992

For a simple Yes/No, it is possible to use a power shell script. See this project as an example:
image

#Value  Description   
#0 Show OK button. 
#1 Show OK and Cancel buttons. 
#2 Show Abort, Retry, and Ignore buttons. 
#3 Show Yes, No, and Cancel buttons. 
#4 Show Yes and No buttons. 
#5 Show Retry and Cancel buttons. 
#http://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx

$a = new-object -comobject wscript.shell 
$intAnswer = $a.popup("Question?",2,"Title",4) #first number is timeout, second is display.

#7 = no , 6 = yes, -1 = timeout

MessagePopUpAutoClose.zip (2.5 KB)

I took the idea for the script from here. Make sure to read the docs of the PowerShell command, as those will tell you what input is returned :slight_smile: The script returns a number and you have to interpret it according to this table.

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.