Shape bindings are placed in the alt text of a shape or grouped shapes. Parameters inside square brackets like [AltText]
are optional and can be left out. It is possible to have multiple bindings for a shape by using a JSON of the following format:
{
"Bindings":
{
"Hyperlink": [ "Link" ],
"Image": [ "ImagePath", "Fit" ],
"AltText": "Blue lake"
}
}
Or a single binding, example <<Chart:[AltText]$ChartData>>
Multiple binding model
- Bindings (case sensitive, optional) – object parameter. Defines the multi-binding type for processing.
- AltText (case sensitive, optional) – string parameter. Defines the alt text of the shape/table after processing
- Hyperlink, Image, DynamicTable, Table, ShapeVisible – (case sensitive, optional) – single binding parameter. Define a bundle of bindings that is relevant to the bound shape. Bundles are described below.
- Hyperlink – [ “Link” ] – define a parameter holding a hyperlink
- Image – [ “ImagePath”, “FitType”] – define image path in first parameter and type of resize (can be found in Image binding description)
- DynamicTable [ “tableData” ] – define an object reference
- Table [ “tableData”] – define an object reference
- ShapeVisible [ “Show” ] – define a Boolean parameter determining visibility
- FillColor [ “ColorParameter”] – define a parameter reference containing an RGB value
Depending on your object type – Image, Shape, or Table, one can define different bundled bindings.
Image – one can define Hyperlink, Image, ShapeVisible bindings and AltText parameter.
Shape – one can define Hyperlink, FillColor, ShapeVisible bindings and AltText parameter.
Table – one can define Table, DynamicTable, ShapeVisible bindings and AltText parameter.
Chart
Update a chart with information from the input data by adding the binding to the alt text of the chart in the format: <<Chart:[AltText]$ChartData>>
Parameters
- AltText
String to replace the binding in the alt text of the shape. - ChartData
JSON path for the ChartData object. It is used for updating the data of the chart.
The ChartData object may have the following attributes:
Property | Type | Description |
---|---|---|
title | string | The title of the chart. Is ignored if null. |
primaryValueAxisTitle | string | The primary value (vertical) axis title. Is ignored if null. |
primaryCategoryAxisTitle | string | The primary category (horizontal) axis title. Is ignored if null. |
categories | string[] | The values of the x-axis. Is optional. |
series | SeriesData[] | The data for each series. Series in the chart will be added or removed as needed. Formatting of new series are based on the last series in the chart. |
Property | Type | Description |
---|---|---|
name | string | Legend name of the series. Is optional. |
values | number[] | The values of the y-axis in this series. |
labels | string[] | The data label of the value with the same index. Use null to remove the data label. Is optional. |
Categories, values, and labels must be of the same dimensions, or null in order to produce a valid chart.
Extended Chart
Types
- Box and whisker
- Funnel
- Region Map
- Sunburst
- Treemap
- Waterfall
Update a chart with information from the input data by adding the binding to the alt text of the chart in the format: <<ExtendedChart:[AltText]$ChartData>>
Parameters
- AltText
String to replace the binding in the alt text of the shape. - ChartData
JSON path for the ChartData object. It is used for updating the data of the chart.
The ChartData object may have the following attributes:
Property | Type | Description |
---|---|---|
title | string | The title of the chart. Is ignored if null. |
primaryValueAxisTitle | string | The primary value (vertical) axis title. Is ignored if null. |
primaryCategoryAxisTitle | string | The primary category (horizontal) axis title. Is ignored if null. |
categories | string[] | The values of the x-axis. Is optional. |
extendedCategories | CategoryData[] | The data for each category. Categories in the chart will be added or removed as needed. |
series | SeriesData[] | The data for each series. Series in the chart will be added or removed as needed. Formatting of new series are based on the last series in the chart. |
subtotals | number[] | The indexes of the series that is to be considered a subtotal. This is only relevant for Waterfall charts. Is optional. |
Property | Type | Description |
---|---|---|
name | string | The name of the category. Is optional. |
categories | string[] | the values of each category or the x-axis depending on the type. |
Property | Type | Description |
---|---|---|
name | string | Legend name of the series. Is optional. |
values | number[] | The values of the y-axis in this series. |
Categories and values must be of the same dimensions, or null in order to produce a valid chart.
Image
Inserts an image into an image shape by adding the following in alt text.<<Image:[AltText]$ImagePath$FitType>>
Parameters
- AltText
Alt Text of the generated image - Imagepath
JSON path of the string that contains the image. The string can be either a Base64 encoded image, or an URL leading to a file. - FitType
Can be one of the following values- Fit
The image will fit inside the shape, leaving whitespace at either x- or y-axis if the image ratio does not match the image shape. - Fill
The image will fit inside the shape, cropping parts of the image to fit. - RawFit
RawFit is similar to Fit but uses PowerPoint’s cropping feature. This has better performance, but the image is not resized which might result in a larger presentation. - RawFill
RawFill is similar to Fill but uses PowerPoint’s cropping feature. This has better performance, but the image is not resized which might result in a larger presentation.
- Stretch
The image will stretch, changing the aspect ratio if necessary to fit.
- Fit
Hyperlink
Adds or replaces the link of the shape.<<Hyperlink:[AltText]$Link>>
For example, it could say: <<Hyperlink:Link for homepage$webLink>>
where the alt text would say “Link for homepage” and when pressing the shape it will open the https found in the transformation at “webLink”.
Parameters
- AltText
String to replace the binding in the alt text of the shape. - Link
JSON path for the URL to link to. The URL must be a full valid format, e.g., http://www.example.com
Table
Table binding can be defined with following binding:
<<Table:[AltText]$tableData>>
Description
This binding allows to control a table cell binding with fixed table size.
Parameters
- AltText – string to replace the binding in the alt text of the table
- tableData – object with a defined model representing the configuration of the table
Model
- cellBackgroundColor – (case sensitive, optional) – list parameter.
- Every list parameter is an object that takes a list of values. Every object represents a row index and every value from the object represent a cell index. Value type is an html color value. For example: “Green”. NULL defines no coloring on a cell.
- cellValues – (case sensitive, optional) – list parameter.
- Every list parameter is an object that takes a list of values. Every object represent a row index and every value from the object represent a cell index. Any value is relevant, but it will be resolved to a string value. NULL defines no value on a cell.
Example of a JSON for table bindings:
"operationsTrendTable": {
"cellBackgroundColor":
[
[
null,
"Green",
"Yellow",
"Yellow"
],
[
null,
"Green",
"Green",
"Yellow"
]
],
"cellValues": [
[
"first row first cell value",
null,
null,
null
],
[
"second row first cell value",
null,
null,
null
]
]
}
Dynamic Table
Dynamic table can be defined with following binding:
<<DynamicTable:[AltText]$tableData>>
Description
This binding controlling a table in terms of the number of columns and rows as well as its formatting.
Parameters
- AltText – string to replace the binding in the alt text of the table
- tableData – object with a defined model representing the configuration of the table
Model
- Options (case sensitive, optional). Properties in the Options object define general properties for the table or its formatting. Currently we support only 2. These are:
- KeepTotalWidth (case sensitive, optional) – Boolean parameter. Set to true if you want to keep the same width of the table as before processing. False or NULL means that width will not be preserved.
- KeepBottomBorderOnPopulatedRows (case sensitive, optional) – Boolean parameter. Set to true if you want to preserve the same bottom border formatting when populating the last row (native dynamic table behavior).
- Headers (case sensitive, optional) – list parameter. If defined – it controls the number of columns in the resulted table. It can either be a hardcoded number of objects or dynamic coming from another object (Jmes transformation). Each object defined in this parameter must contain a “Visible” parameter that controls the visibility of that column. If NULL, processing will not control the number of columns in the table.
- Visible – (case sensitive, required) – Boolean parameter. Parameter that controls visibility of the existing or populated column. If set to true, it shows the column. If false – hides the column.
- Rows (case sensitive, optional) – list parameter. If defined – it controls the number of rows in the resulted table. It can either be a hardcoded number of objects or a dynamic coming from another object (Jmes transformation). The first object in the list defines the header values – if you wish to not change header values – define the object but leave it empty. If the list size is larger than the existing number of rows – the processing will populate the last row to match the size from the list. If less – the processing will decrease the number of rows. Each object can define an unlimited number of properties for the row and certain parameters defining options for the row.
- __mergeCells – (case sensitive, optional) – Boolean parameter. If defined and set to true, the processing will merge all cells from the row. False value leaves existing row config in terms of merges.
- __alignment – (case sensitive, optional) – Paragraph alignment parameter. It can take these inputs: Left, Right, Center, Justified, JustifiedLow, Distributed, ThaiDistributed. Usually defined together with __mergeCells to control the final text alignment of the paragraph after merging.
- Cells – (case sensitive, optional) – list parameter. If defined – it controls the formatting of cells in that particular row. The index of the object in the list is 1:1 with the cell index. That means if you want to adjust formatting on the last cell of the row, you need to define the same number of objects as the number of cells and define formatting properties on the last object.
- BackgroundColor – (case sensitive, optional) – string rgb parameter. Define with a specific rgb code if you would like to control the background formatting of the cell. Supported format: “125,125,125”. Any other format defined will not take effect.
Example of a JSON object that can define a dynamic table:
{
"tableData":{
"Options": {
"KeepTotalWidth": true,
"KeepBottomBorderOnPopulatedRows": true
},
"Headers" :
[
{
"Visible" : true
},
{
"Visible" : ValueFromMyData
},
{
"Visible" : Value2FromMyData
}
]
"Rows":
[
{
"H1" : "Header value 1",
"H2" : "Header value 2",
"Cells":
[
{
"BackgroundColor": "160,220,255"
},
{
"BackgroundColor": "208,208,208"
},
{
"BackgroundColor": "160,220,255"
}
]
},{
"L1" : "Second row value",
"L2" : "Second row value 2",
"__mergeCells": Value3FromMyData,
"__alignment" : "Right",
"Cells":
[
{
"BackgroundColor": "160,220,255"
},
{
//Left empty intentionally
},
{
"BackgroundColor": "160,220,255"
}
]
}
]
}
}
FillColor
FillColor binding can be defined as the following:
<<FillColor:[AltText]$rgbColor>>
Description
This binding allows us to set a fill color on a shape (not a table or image). It supports RGB format only.
Parameters
- rgbColor – parameter holding an RGB value.
- AltText – alt text to be set after processing (optional)