> For the complete documentation index, see [llms.txt](https://docs.work-relay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.work-relay.com/forms/using-forms/how-to-run-form-action-from-lightning-component.md).

# How to run form action from lightning component

To run form action from lightning component one has to fire WR\_BPM:ApplicationEvent event and pass following JSON object as "data" parameter:

```json
{
	"target": "{FORM_ID}",
	"busEvent": {
		"source": "external",
		"actions": {
			"{FORM_ACTION_NAME}": {
              "parameters": {
                  "{FORM_ACTION_PARAMETER_NAME}": "{PARAMETER_VALUE}"
               }
           }
        }
    }
}
```

Parameter value should be replaced with value that needs to be passed from Lightning component or any value from the form itself. To pass form values as action parameters use form objects, such as {$Form}, {$Variables}, form Context Object ect.

Function in below example will run 'Check options' action on the form.

```javascript
runAction : function(component, event, helper) {
    var params = 'January;March';
        
    var appEvent = $A.get("e.WR_BPM:ApplicationEvent");
    var jsonObject = {
		"target": "{FORM_ID}",
			"busEvent": {
             "source": "external",
              "actions": {
                  "Check options": {
                      "parameters": {
                          "options": params
                       }
                   }
               }
          }
     };
     
     appEvent.setParams({"data" : jsonObject});
     appEvent.fire();
        
}
```

See form action setup:

![](/files/94a93ff5ea049ad6a9e50a25a4acbfaae3650393)

and picklist setup:

![](/files/52f42faabe2f0be8b2ce497f58969d077d73dea8)

Execution of action triggered from the Lightning Component will check January and March options of picklist:

![](/files/8ccb9bde917757415cf4125d1e95fa498c2d58c3)
