> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aseeflow.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Available API

Inside a form script, the following built-in variables and functions are available:

## camForm

The `camForm` variable is an instance of the `CamSDK.Form` class. It is the primary access point to
the form API and allows definition of event handers for participation in the form [lifecycle](/reference/forms/embedded-forms/lifecycle):

```html theme={null}
<form role="form">
  ...
  <script cam-script type="text/form-script">
    var variableManager = camForm.variableManager;

    camForm.on('variables-fetched', function() {
      // access to all process variables after the form has loaded
      console.log(variableManager.variables);
    });
  </script>

</form>
```

## \$scope

<Info>
  Only available with AngularJS integration.
</Info>

Provides access to the current AngularJS scope:

```html theme={null}
<form role="form">

  <input type="text"
         cam-variable-name="CUSTOMER_ID"
         cam-variable-type="String"
         ng-model="customerId" />

  <script cam-script type="text/form-script">
    camForm.on('variables-applied', function() {
      // the input field is bound to $scope.customerId
      $scope.customerId = "some-id";
    });
  </script>

</form>
```

## inject()

<Info>
  Only available with AngularJS integration.
</Info>

```html theme={null}
<form role="form">

  <script cam-script type="text/form-script">
    inject(['$http', 'Uri', function($http, Uri) {
      camForm.on('form-loaded', function() {
        // use injected $http service for making requests, e.g.
        $http.get(Uri.appUri('engine://engine/:engine/task/' + camForm.taskId)).then(function(task) {
          $scope.task = task;
        });
      });
    }]);
  </script>

</form>

```
