HomeGuidesRecipesAPI
HomeGuidesAPILog In

Actions Overview

SmartIQ Actions incorporate the ability to pass eForm data and generated documents to third-party systems, data stores or trigger specific events based on business rules. SmartIQ includes several Actions that covers the majority of everyday tasks.

If for any reason the required event is not covered by the Out of the Box Actions, please check our Ecosystem.

Here a simple guide that explains how to add and configure Actions in SmartIQ.

Adding an Action to a Project

  1. Create or open an existing project in Design.

  2. Ensure 'Action' is available in the toolbox.

  1. There are two ways to add an action to your project:
  1. The 'Select Action' window will display.

  1. By default, SmartIQ adds the following actions:
  1. Drag and drop an action from the list on the Finish page.

  2. The action you selected will now be added to the Finish page. The added action can now be configured by adding the parameters in Design.

👍

Retry On Failure

Clicking Retry On Failure checkbox allows user to specify the number of retries and wait between retries.

📘

Notes

  • Actions can only be added to the 'Finish' page in the design window, an action can also be added to a transition in a workflow. (refer to How to add actions to workflow transitions article).

  • You can have more than one of the same action type on the Finish Page of a project.

  • If your action is a Finish action (it was added to the 'Finish' page), the form will always finish before that action runs. If the form is expected to finish when the call is successful, a run action button can be used. For more information see Run Action Button.

  • Because Actions run after the project answers have been saved, Actions cannot be used in workflow transitions to update project properties.

Adding Actions to Workflow Transitions

Actions can be added to transitions in a workflow, for this you will need to know how SmartIQ Workflow works. For more information see Workflows.

  1. Open a project with a valid workflow in design.

  2. Click the Workflow button.

  3. Select a transition.

  4. Click the Actions button.

  5. The Actions list will pop up.

  1. Drag and drop the action you would like to add to the transition. In this example, we are using the Redirect action. The action will now be added in between the state that transition was going to.

  1. Click to select the Redirect action.
  2. Once configured, this action will occur on transition from Start to the Start 2 state.

Nested Actions

SmartIQ allows for the creation of nested actions which can reference the output value of the parent action. A nested action can reference that newly created ID and run another action. An action can only be the child of another action if the parent is a repeater.

The following example shows how to create a simple save to disk action nested with an email action. The goal is to save files to different disk locations and nesting an email action to it which sends email notifications containing the location to different users.

  1. Create a repeating section File Saver with a text field for entering the document save location and a multiple choice for deciding whether to send email notification or not

  2. Create a repeating section Email Sender (which appears based on the selection for the multiple choice question) within the repeating section File Saver with a text field for entering the email addresses of the receivers.

  1. Add a Save to Disk action and set the following properties:

📘

Note

When adding a nested action, the parent action needs to be a valid repeating action.

  1. Drag and drop a new action to the parent action, set it as Send Email and click OK.

  2. Click YES on the opened dialog box

The Send Email action will be nested on the Save to Disk action as per the following image.

  1. Set the following properties for the Send Email action.

  1. Set the condition for which the nested action should be activated and save the project.

The condition will be set in a way that the email will be send only if the document is properly saved in the specified location.

Testing Nested Actions

  1. Open the project and enter the values.

  1. Click Next and then Generate Document.

The results will be the following:

a. The folders Nested Action Test 1, Nested Action Test 2 and Nested Action Test 3 will be created if it’s not already present in the C:\_temp folder and the generated documents will be saved in the other folders.

b. If the folders are created and documents are saved in their respective locations, then emails containing the file locations will be sent to the respective email addresses mentioned in the respective folder sections.

Triggering Document Generation with Actions

You can trigger generated documents on your action(s). This is useful for those situations when specific actions generate specific documents.

This example will demonstrate how to set up a project that has generated documents.

  1. In Design, create a new project.

  2. Add another Word template.

  3. Change the name of both document templates to Doc1 and Doc2.

  4. Add an email action to the Finish page.

  5. Configure the Send email action.

  6. Select the Send Email action and select the Documents tab on the right hand of the screen.

  7. Within the Action Documents screen, select the Custom option and from the 'Document' drop-down menu select Doc1 then click Add.

Once the project has been run (generated) in Produce, Doc1 will be sent to the email address configured in the email action.

Designers can also specify the order of documents.

Action Documents

Files that have been uploaded to the form can be sent via actions to other systems as action documents. Each action document format can can have different formats in Design.

There are different formats available for the type of document selected. If the format selected is Default/None, the document will be generated in the default format selected in the publish options in Manage. By choosing other formats, the documents are generated accordingly to the selected format, for example, Microsoft Word Docx/Docm.

For both a word and PowerPoint template, the populated formats are similar to the ones in Manage > Publish project page.

Additionally, attaching images provides the ability to:

  • Display a preview of the image in the form after it has been uploaded, wherein a document file would not.
  • Allow the user to rotate the image.
  • Maintain separate versions of the original and edited files.
  • Include/exclude the edited/original files as custom action documents.

Once a document and format are selected, the List view will display both of these in two separate columns. A selected document and format cannot be selected more than once. Otherwise, the Add button will get disabled.

When the project is executed in Produce and if specific documents have been selected, the document will only be sent to the action in that format.

📘

Note

The action document format works for both Project Level Actions and Transition Actions.

Run/Show Action Options for Actions

The ‘Run/Show Action When’ attribute allows the user to specify if, and when, they would like the action to run or show.

This option can be found in the Properties tab of the action:

OptionDescription
AlwaysIf this option is selected, the action will run at all times.
NeverIf this option is selected, the action will never be executed.
On FailureIf this option is selected, the action will only run when a generation error occurs.
On SuccessIf this option is selected, the action will run when no generation errors occur when the form is generated.

Run After Option

Once a form is submitted for a workflow transition or completion, SmartIQ will perform a set of tasks in a specific order. Designers can specify when exactly an Action will be triggered, changing the behavior of it.

  1. Submit: Run as early as possible after the user submits the form.
  2. Document Generation: Run after documents are created, still happens even if there are no templates in the project.
  3. Workflow Assignment (only available when the action is added in a workflow transition): Run after the workflow has been assigned to the next user/group, only available on transition actions. Will run before workflow escalations have been set up and also before transition emails have been sent.
  4. Finish: Run after everything else, this is the default.
981

Action Run After options

See the Workflow Transitions section for a detailed discussion of what each stage of the workflow generation process entails.

Action Result Types

An action will return a result as described below. If the result is a failure, an error message will be available in Manage on the Management screen. These result types can be referenced and used as conditions.

Action results:

  • Success – The action ran successfully without error.
  • Fail – The action ran and returned an error.
  • NotRun – If conditions set on the action prevented it from running, it will return this result.
    Action results can be used to control logic in subsequent actions. For example, an email action can be configured to execute in the event of failure.

Referencing Action Response(s)

For actions that contain outputs, these will appear as a expandable set of outputs in the tree view of Design. These can be referenced directly much like any other variable and answer using the Reference picker.

385

Example action outputs for Send to REST service, which are the HTTP Status and Response.

Additionally, they can also be referenced directly using the [Action.Output] notation. In the example above, the REST service response can be referenced as [Send to REST Service.Response].

Referencing Repeating Actions

Actions can also be referenced to a repeating page or section. In the below example we will be showing you how to configure an email action to send to multiple recipients entered in by the user.

  1. Create a new project.
  2. Add a section and a Column.
  3. Make the section repeating.
  4. Then add a text field question, name it Email Recipient.
  5. Add an Email action on the Finish page.

  1. Select the Email action and navigate to the Email Action Properties on the right hand of the window.
    Ensure the Repeat check-box is checked, which enables the repeat function for the action.
  2. From the Repeat Source drop-down menu select the repeat section. For example, Email: Section 1. This enables you to be able to select the particular source you want the data to be referenced from.

  1. There are two ways you can reference the Email Recipient Text Field to the email action:
    • Select Fixed Value type from the drop-down and use the reference tool.
    • Select Answer Value type from the drop-down and select the question and answer.
  2. Configure the remaining required email attributes.
  3. Save and publish the project.

📘

Action Repeat Inputs

Actions can also define their inputs as being repeated. This works similar to fragment repeating input.

Dynamically Assigning Groups to Users with User Action

To dynamically create a user and assign multiple groups via the SmartIQ user action, add a replace formula that breaks the string and separates the selected group on each line via an ASCII code.

This is because the group names are coming from multiple row data source so it will be one string with a pipe delimiter that separates each value. For example, with GroupA|GroupB|GroupC, the action will be looking for the GroupA|GroupB|GroupC group name which does not exist as the groups need to be 1 per line, and so this will not work.

=Replace([q37.GroupName], “|”, chr(10))

Then reference the formula to the Groups attribute.

This will bring the string into the Groups attribute as 1 per line.