Create Blocks
Include blocks in your Kizen app to display custom content tiles on dashboards, homepages, chart groups, and record details pages.
Overview
Blocks are tiles of content that sit in dashlet grids on dashboards, homepages, and chart groups (see Figure 1).

Blocks can also appear on record details pages (see Figure 2).

After a user installs your app, they can place your blocks among their existing dashlets and content on these four types of pages.
The content of a block can come from custom HTML, or you can embed the content from a page on the web.
Add a block to your app
Add your block to the blocks directory in src. Place each block in its own subdirectory with config.json, script.js, and styles.css files as needed, like this:
The following table describes these files:
config.json
JSON
The configuration file for the block.
Yes
script.js
JavaScript
The script that runs when the block loads.
Yes
styles.css
Cascading Style Sheet
The styles for the content in the block. If the block embeds content from an outside source, you don't need this file.
No
Blocks also support event scripts. Place event scripts in the block's eventScripts subdirectory. For more information about event scripts, see the coding reference.
See below for details on each of these files.
About config.json for blocks
The configuration file for a block sets the properties of the block:
The keys are as follows:
name
The name of the block.
Yes
api_name
The API name of the block in all lowercase letters. If you don't specify a value for this key, the system automatically generates one based on the name of the block's subdirectory.
Yes
min_w
The smallest allowable width of the block in grid columns (1–12). This key applies to blocks of the charts, dashboards, and homepages types.
No
max_w
The largest allowable width of the block in grid columns (1–12). This key applies to blocks of the charts, dashboards, and homepages types.
No
min_h
The smallest allowable height of the block in grid rows (1–24). This key applies to blocks of the charts, dashboards, and homepages types.
No
max_h
The largest allowable height of the block in grid rows (1–24). This key applies to blocks of the charts, dashboards, and homepages types.
No
recommended_height
The default height of the block in pixels (100–800). This key applies to blocks of the records type.
No
types
An array of page types on which the user can add the block:
charts. The user can add the block to the chart group of a record list page.dashboards. The user can add the block to a dashboard page.homepages. The user can add the block to a homepage.records. The user can add the block to a record details page.
Yes
when
A condition that determines when to show the block on the screen. For more information, see the coding reference.
No
About script.js for blocks
The JavaScript file for a block is the block's main script. Kizen runs the script when the block loads, including when the user refreshes or resizes the browser window or changes the filters on a dashboard page. The script sets the starting state of the block.
The script can use standard JavaScript, most web APIs available to Web Workers, and Kizen's runtime API. Because the script acts as the signed-in user, it can do whatever the user can do in Kizen, with the same permissions, and it knows the user's name and currently active business. For all page types except for homepages, it also knows details about the page on which the block appears, such as the record on a record details page or the values of the filters on a dashboard page. The script can read this information from properties of the this.args object, although the exact properties depend on the page type. See the following table for details.
dateFilter
The dashboard's date range as start and end dates
dashboards
entityId
The ID of the specific record
records
objectId
The ID of the record object
charts, records
teamFilter
The values of the dashboard's team filters as set by the user
dashboards
Keep in mind:
A block script controls only its own tile. It can show toasts and modals and navigate to other pages in Kizen, but it can't otherwise change the browser window outside the tile. It can, however, launch the event script of another block from the same app on the same page. See Run the event script of another block on the page below for more information.
A block script runs only while the page holding the block is open. Navigating to another page or closing Kizen entirely stops the script. For tasks that need to run on their own, use an agentic workflow code step instead.
A block script starts fresh each time the block loads. To carry values from previous runs, store them in the user’s configuration or as short-term session data. For details, see the coding reference.
A block script must finish before the user can interact with the block. Code that runs on a loop or long delay belongs in an event script.
Paint content into the block
To paint content into the block, use one of two methods: this.outputUI() or this.outputIframe().
For HTML and CSS, use this.outputUI():
The method takes a single HTML string as its argument. The CSS comes from the block's styles.css file or from inline style attributes in the HTML. For security, Kizen strips out <script> tags, event handlers, and javascript: links but leaves SVG, images, and <iframe> elements. For more information, see the coding reference.
To embed a live web page, use this.outputIframe():
The page loads from its own server and runs its own code, so it can update itself. The address must start with https://, and the site must allow embedding. For more information, see the coding reference.
Run the event script of another block on the page
From the script.js file of the current block, you can launch the event script of an entirely different block using the this.communicate.runBlockScript() method:
Keep in mind:
The target block must belong to the same app as the current block. You can't target blocks that belong to different apps.
The target block must be on the same page as the current block. If it isn't, nothing happens.
If the target block appears more than once on the page, every instance runs the same event script. You can't target them individually.
For more information on this.communicate.runBlockScript(), see the coding reference.
About styles.css for blocks
The style sheet for a block provides the style definitions for the classes in the block's custom HTML:
You don't need a style sheet if your block uses this.outputIframe() to embed a live web page.
Add a block to a page
When a user installs your app, your app's blocks don't automatically appear in Kizen. The user must manually add them to the appropriate pages. Each block's types configuration key determines which types of pages it can appear on:
charts
Record list pages
dashboards
Dashboard pages
homepages
Homepages
records
Record details pages
After you add blocks from an app to pages in Kizen, uninstalling the app hides the blocks on record details pages but shows placeholder tiles on all other page types. Reinstalling the app returns the blocks to their placeholders.
For step-by-step instructions on adding blocks to each page type, keep reading.
Add a charts block to a record list page
To add a charts block to a record list page:
Add the block
To add the block:
Select Add Chart. The Add New Block modal appears (see Figure 4).

Under Integrations, select the app with the block that you want to add. The controls on the modal change (see Figure 5).

From the dropdown menu, select the block to add.
To display a subtle shadow under the block's tile, turn on the drop shadow effect.
Select Add. The modal closes, and the block appears on the page.
Drag the lower right corner of the block to adjust its size.
Add a dashboards block to a dashboard page
To add a dashboards block to a dashboard page:
Add the block
To add the block:
Select Add Dashlet. The Add New Block modal appears (see Figure 7).

Under Integrations, select the app that has the block that you want to add. The controls on the modal change (see Figure 8).

From the dropdown menu, select the block to add.
To display a subtle shadow under the block's tile, turn on the drop shadow effect.
Select Add. The modal closes, and the block appears on the page.
Drag the lower right corner of the block to adjust its size.
Add a homepages block to a homepage
To add a homepages block to a homepage:
Add the block
To add the block:
Select Add Block. The Add New Block modal appears (see Figure 10).

Under Integrations, select the app that has the block that you want to add. The controls on the modal change (see Figure 11).

From the dropdown menu, select the block to add.
To display a subtle shadow under the block's tile, turn on the drop shadow effect.
Select Add. The modal closes, and the block appears on the page.
Drag the lower right corner of the block to adjust its size.
Add a records block to a record details page
To add a records block to a record details page:
Customize the record layout
To customize the record layout:
Go to the Customize Layout step of the custom object editor (see Figure 13).

From the Choose Layout to Modify dropdown menu, select the layout on which to add the block.
In the work area under Customize Record Layout, choose a column of the record details page into which to add the block, and select its Add Layout Component control (see Figure 14).

Kizen opens the Add Layout Component modal (see Figure 15).

Add the block
To add the block:
Under Integrations in the modal, select the app that has the block that you want to add. The controls on the modal change (see Figure 16).

From the Choose Block dropdown menu, select the block to add. Kizen automatically sets its recommended height.
Drag the Block Height slider to change the height of the block if you prefer.
In the Internal Block Name field, type a name for the block. This name is how Kizen refers to the block in the Customize Record Layout work area.
Select Save. The modal closes, and the block appears in the Customize Record Layout work area (see Figure 17).

Drag the block elsewhere in the work area to position it where you like among the other pieces of content on the record details page (see Figure 18).

Select Save at the top of the custom object editor.
What's next?
Continue to Create Data Adornments to learn how to create data adornments for your app.
Last updated
Was this helpful?



