Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Click the + sign to create a new block template.

In this case article we will create a new block for the Test application (which is registered to our account), which will return an array of employee names from the Test app API. (The Test app provides dummy data for testing purposes.)

...

  • The Configuration Manager tab lets you create block questions, which are settings that can easily be changed by without the need for coding to customize the block.

  • The Code Editor tab is where you write and debug the code for the block

  • The Input Model tab lets you define the schema/model that the block accepts/expects as input.
    (This information is used by the Mapper block to fill out field names and types in the mapping table.)

  • The Output Model tab lets you define the schema/model that the block gives as output.
    (This page is often left blank, as the Mapper block can dynamically create the model by sampling the output data from the block.)

Sections in this article:

Table of Contents

Configuration Manager

The Configuration Manager tab lets you configure the block settings (aka “block questions”) that will be shown to users of the block:

...

The Code Editor tab is where you enter the actual code that will be used by the block:

...

Input Model Editor

The Input Model tab lets you define the schema/model in JSON format that the block accepts/expects as input. This information is used by the Mapper block to fill out field names and types in the mapping table.

Since the block .

...

See articlewe have created in previous steps does not accept incoming data (i.e. it does not use Datasource in its code), there will no need to define an Input Model.

Here is instead an example of an input model from a different block:

...

Output Model Editor

Similar to the Input Model, the Output Model lets you define the schema/model that the block gives as output. This page is often left blank, as the Mapper block can dynamically create the model by sampling the output data from the block.

Committing changes and publishing the template

Block templates in Canvas are version controlled. This enables you to potentially make changes to blocks across many workflows, without having to edit each individually.

...

Register an Input Model

...

Image RemovedImage RemovedImage Removed. This works the same way as previously described for workflow templates:

  • You can make changes to the template by clicking the pencil icon in Workbench.

  • Changes made in workbench will first have “draft” status:

...

  • Click the Publish icon to make the block template available for use in the workflow editor:

...

 

When committed, the changes will be replicated to all instances of the block template, in all workflows where it is in use.

If you for example have 100 workflows each using a block based off of the same block template, then changes you make and commit to the block template will be replicated to all 100 blocks in the 100 workflows (unless the blocks have been “customized” by having the code altered in the workflow editor).