Copy and Paste Actions

During the course of developing integrations there may be situations where it is necessary to copy actions from one data flow to another. This is easily achieved by using code snippets to copy and paste actions.

Copying Actions

Any action or a series of actions can be copied. On any data flow chart in any project, change the selection mode to either "multiple" or "branch". Then select all the actions that need to be copied. Selection options appear just above the chart. Click "View Source of N Actions" which will load the source code snippet view for all selected actions.

Sample view of automatically generated API documentation for a project.

The snippet view shows the action data for each of the selected actions. Collectively, this code is called a snippet. Either manually select the source code and press Ctrl+C or Cmd+C to copy the snippet, or simply press the "Copy Code Snippet" button at the top.

Sample view of automatically generated API documentation for a project.

Pasting Actions

Copied code snippets can be pasted anywhere. This includes any project and any data flow that the user has access to modify. It is possible to paste snippets at the beginning, inline, or at the ending of data flow. Entire data flows can also be copied and pasted.

To paste a code snippet, click on the "Use Source Code" button on the new action menu.

Sample view of automatically generated API documentation for a project.

The insert code snippet view appears. Paste the snippet into the source code editor. The editor will validate the snippet and display an "Insert Actions" button when the snippet is valid. Pressing the "Insert Actions" button will commit the snippet to the project and insert it into the selected location in the data flow.

Sample view of automatically generated API documentation for a project.

The entry point selection view appears above the code editor when inserting a code snippet into the middle or at the end of an existing data flow. This view shows the name of the action that will be the parent of the pasted actions under the "Insert Code After" label.

Similarly, the exit point selection view appears below the code editor when inserting a code snippet into the middle of a data flow. This view shows the name of the action that will be the child of the pasted actions. When pasting a snippet that has multiple branches, it is important to select the action that will be the exit point of the newly pasted actions. The exit point action will become the parent of the child action displayed under the "Insert Code Before" label.

Important Things to Note

  1. Any code snippet that is pasted must contain contiguous actions. This means that every action in the pasted snippet must be able to trace its parentage back to the action designated as the "Snippet Entry Action". The view will display a warning and detail which actions are anticipated to orphaned. The process will not allow the snippet to be inserted into the project until all orphaned actions are removed from the snippet.
  2. The copy and paste functionality supersedes the clone action feature which has been deprecated and is no longer available.