activities
latest
false
UiPath logo, featuring letters U and I in white

Workflow Activities

Last updated Dec 20, 2024

Running forms using JavaScript

You can execute JavaScript while a form is displaying, using the Run Form Script activity. This tutorial demonstrates how to display a simple JavaScript alert while a form is showing.
Note: To help you achieve your use case with JavaScript, don't forget to inspect the form elements at runtime using DevTools. To open DevTools on a form, right-click inside the body of the form while it's showing, and click Inspect.
  1. Create a Form file on top of which you want to execute JavaScript.
  2. Add a Show Form activity and select the form that you created at step 1, and make sure that Continue Workflow Execution is enabled.
  3. Add a Run Form Script activity and select the form that you created at step 1.
  4. Inside the Source property field, add the JavaScript between double quotes " ".
    For this example, use the following JavaScript to show an alert on top of the form:
    "alert('You can now close the form!')""alert('You can now close the form!')"
  5. Run the workflow to display the form. Right-click inside the body of the form at runtime, and then click Inspect.
    DevTools opens and you can inspect your custom JavaScript to debug it.




Workflow example

To follow the steps and try out the tutorial yourself, see this sample project.

  • Workflow example

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.