Skip to main content

copyToInformPayload

A Workflow Engine function that is an eventless clone of the copyToPayload function, copying data into the Inform payload rather than a CEvent-specific payload.

The data that is copied can be either plain text or a substitution for an existing workflowContext field.

This function adds additional data to a payload as part of an Inform-based export (where the export is triggered externally and not by a CEvent object).

This function must be preceded by the getPayloadFromInform function, which first creates the payload to copy into.

For example, given a workflow with the following actions:

  • getPayloadFromInform - creates a base payload

  • copyToInformPayload - adds data to the base payload

  • exportViaRestFromInform- exports the payload to a REST endpoint.

The exportViaRestFromInform function exports the combined payload created by the getPayloadFromInform and copyToInformPayload functions.

This function is available as a feature of the Add-ons v2.3.5 download and later.

This function is available for event, alert, and Situation workflows.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function copyToInformPayload takes the following arguments:

Name

Required

Type

Description

payloadKey

yes

string

The key in the payload to place data in

value

yes

string

The value can be either a direct value or a substitution from the workflow context. Example: $(workflowContext.key1)

Example

The following example demonstrates typical use of Workflow Engine function copyToInformPayload.

During an Inform-based export, we want to add a static value to the payload:

{
  "environment" : "Production"
}

Configure the copyToInformPayload with a payloadKey of environment and a value of “Production."

This appears in the UI as:

{"payloadKey":"environment","value":"Production"}

The payload before copyToInformPayload runs:

"payloads": {
        "inform": {
            "topo": "bgp",
            "sev": "Critical",
            "test": "12345",
            "deep": 100,
            "label": "e=f"
        }
    }

This function returns true if the data was copied successfully into the payload, and false if the data was not successfully copied, or if no payload could be found.

The payload after copyToInformPayload runs:

"payloads": {
        "inform": {
            "topo": "bgp",
            "sev": "Critical",
            "test": "12345",
            "deep": 100,
            "label": "e=f",
            "environment": "Production"
       }
   }