Components

Components

pageCommunication
  • Communication response is extended with wrapper object.

  • limit is not available in response as the result of action should always be only one bundle

  • Communication can be request-less.

response.wrapper

Required: no Default: output

This directive lets you post-process module output before returning it to the user. The output of the module will be available to you as the output context variable - the result of processing the output directive. When used, the value of the wrapper directive is what will become the final output of the module. This directive is executed only once and at the end of the processing chain. There are no more directives or transformations after it.

Sample usage of the wrapper directive:

{
	"url": "/api/users/",
	"method": "GET",
	"response": {
		"iterate": "{{body.users}}",
		"output": {
			"label": "{{item.name}}",
			"value": "{{item.id}}"
		},
		"wrapper": {
			"someAdditionalStuff": "helloworld",
			"aNumber": "{{body.aValue}}",
			"data": "{{output}}"
		}
	}
}

As you can see. After the response is returned, first, the iterate directive is called and it starts iterating body.users and pushes them to the output. Then the wrapper directive is processed and it wraps the original output, which is an array of iterated values, with some additional values. The wrapper is then an actual output of the module.

pageStatic parameters

You can use static parameters inside the Action module without any restrictions.

pageMappable parameters

You can use mappable parameters inside the Action module without any restrictions.

pageInterface

Remember that the Action module should always output only one bundle.

pageSamples

To help the users with setting up your module, you can provide samples to it.

pageScope

When using an OAuth type of connection, use the Scope to define scopes required by this action.

Available IML variables

These IML variables are available for you to use everywhere in this module:

  • now - Current date and time

  • environment - TBD

  • temp - Contains custom variables created via temp directive

  • parameters - Contains module’s input parameters.

  • connection - Contains connection’s data collection.

  • common - Contains app’s common data collection.

  • data - Contains module’s data collection.

  • scenario - TBD

  • metadata.expect - Contains module’s raw parameters array the way you have specified it in the configuration.

  • metadata.interface - Contains module’s raw interface array the way you have specified it in the configuration.

Additional variables available to Response Object:

  • output - When using the wrapper directive, the output variable represents the result of the outputdirective

Additional variables available after using the iterate directive, i.e. in wrapper or pagination directives:

  • iterate.container.first - Represents the first item of the array you iterated

  • iterate.container.last - Represents the last item of the array you iterated

Additional variables available to Pagination and Response Objects:

  • body - Contains the body that was retrieved from the last request.

  • headers - Contains the response headers that were retrieved from the last request.

  • item - When iterating this variable represents the current item that is being iterated.

Example

Last updated