> For the complete documentation index, see [llms.txt](https://docs.flexikanban.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flexikanban.ai/components/forms/using-form/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 FLX\_KB:ApplicationEvent event and pass following JSON object as 'data' parameter:

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

{% hint style="success" %}
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.
{% endhint %}

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

```
runAction : function(component, event, helper) {
    var params = 'January;March';
        
    var appEvent = $A.get("e.FLX_KB: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:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FpmZpFq4YoPJix5jODHno%2Ffile.excalidraw.svg?alt=media&amp;token=bf753a50-086d-4c94-8882-9fb98fcb01bc" alt="" class="gitbook-drawing">

and picklist setup:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2Fu57Y0oxf7Gxg8Zbsfjiz%2Ffile.excalidraw.svg?alt=media&amp;token=22ea3bcf-284a-4f0e-a01f-567e786b43a9" alt="" class="gitbook-drawing">

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

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2F86CBi2M3B8rMZeigSxEH%2Ffile.excalidraw.svg?alt=media&amp;token=5c89100d-4916-4e79-803e-f022a8e6db3d" alt="" class="gitbook-drawing">


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flexikanban.ai/components/forms/using-form/how-to-run-form-action-from-lightning-component.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
