Prompt - Examples                                  How to use?

 

Example 1: To prompt user for the Start and End date and generate a sales report between these dates.

  1. Select 'Don't Write In Any Window' from the drop down list.
  2. Type in the message that you want to prompt the user with to get the Start date.
  3. Assign the value that user enters to a variable by selecting the variable from the variable list.
  4. Similarly assign the 'End' date entered by the user to another variable.
  5. You can use these two variables in place for the start and end dates in your task that generates the sales report.
  6. When the task runs these two variables will be assigned the values that user enters.

Example 2: Create a task that prompts the user for user data and automates the installation of an application.

  1. Click on 'Record' button in Automation Anywhere and automate the installation of your application.
  2. If you plan to run this task on different computers with different resolutions, then we suggest to use the keyboard as compared to mouse during the recording process.
  3. Once you are done with the recording and saving the task, select it and click on 'Edit'.
  4. Identify your keystroke actions like the actions where you entered the Installation folder etc.
  5. Select the action and Right-click (OR click on 'Actions' button) and select 'Convert to Prompt'
  6. This will convert your recorded keystrokes into Prompt command and it will prompt the user for values when the task runs.
  7. This way you can make a generic task to automate your application and not depend on the values that you entered while recording.

Example 3: Prompt for a file which is further used in a loop to enter data.

  1. Open the Task Editor from Tools -> Task Editor
  2. Double click on the 'Prompt for file'
  3. Enter the desired caption.
  4. Enter the custom message for the user to feed in the file.
  5. Assign the value to a list variable from the list.
  6. Expand the 'Loop' command and double click on List'.
  7. Select the list variable which you assigned to the file.
  8. Double click on 'Insert Keystrokes' command.
  9. Select the window tile from the list of the file in which data is to be entered.
  10. Type your data which you want to insert in to the file.
  11. Click on 'Save' button.

Note: This is a procedure for a single file. You can do the same for multiple files. You will just have to check on 'Enable this task to run with similar window titles/files' under 'General Tab' under 'Properties' menu.

Example 4: Prompt for the folder which contains the setup files (setup.exe).

  1. Open the Task Editor from Tools -> Task Editor
  2. Double click on the 'Prompt for folder'
  3. Enter the desired caption.
  4. Enter the custom message for the user to select the folder.
  5. Assign the value to a value variable from the list.
  6. Click 'Save' button.
  7. Double click on 'Open Program/File'.
  8. Insert the variable to which the value of the folder was assigned followed by '\setup.exe' in the Program/File path.
  9. Click 'Save' button.

Example 5: Prompt the user for confirmation before deleting a record from a database.

  1. Open the Task Editor from Tools -> Task Editor
  2. Insert the command to connect to the desired database.
  3. Double click on the 'Prompt for Yes/No'
  4. Enter the desired caption.
  5. Enter the custom message for the user to select the desired option (Yes/No).
  6. Assign the value to a value variable from the list.
  7. Click 'Save' button.
  8. Double click on
  9. Insert an ''If - Variable' condition to check the whether the variable to which the value has been assigned (Step 6) has the value 'Yes'.
  10. Click 'Save' button.
  11. Double click the 'Database->Insert/Update/Delete' command and specify the delete statement to delete a record from a particular table.
  12. Click 'Save' button.
  13. Insert the variable to which the value of the folder was assigned followed by '\setup.exe' in the Program/File path.
  14. Double click the 'Database->Disconnect' command. 
  15. Click 'Save' button.