Set up your account
Before using dynamic placeholders, see the First document use case to set up your platform account and get the API key.Create your document
SFS provides you with two ways of creating documents: by using an API request (API way) or via our React UI (visual way). Let’s create a simple document using our API. To do this, you can use this request. Learn more here.cURL
json
Add a placeholder to your document
First, you need to add a regular placeholder to your document. This placeholder will later be converted into a dynamic table. Learn more about creating placeholders here.cURL
json
Convert the placeholder into a dynamic table
Now that you have a placeholder with a placeholder key, you can convert it into a dynamic table. The table will replace the placeholder in your document and display structured data with columns and rows. Learn more about table placeholders here.cURL
json
isTable property is now set to true, and the value contains a JSON string with the table structure including columns and rows.
View your document with the dynamic table
Awesome! You’ve successfully added a dynamic table placeholder to your document. To view the document with the table, use the Contract Editor component and enter the Contract Key you’ve used as acontractKey property for the component.
The table will be displayed in your document at the position where the placeholder was originally placed. The table
will show all your columns and rows with proper formatting, making it easy for recipients to view structured data
like product lists, pricing information, or any other tabular content.
Understanding table structure
When creating a dynamic table, you need to provide:- Columns: An array of strings that define the column headers (e.g.,
["Product", "Quantity", "Unit Price", "Total"]) - Rows: An array of arrays, where each inner array represents a row with values corresponding to the columns. Values can be strings or numbers (e.g.,
[["Product 1", 2, 100, 200], ["Product 2", 1, 250, 250]])
Updating table data
You can update the table data at any time by making the same update request with newcolumns and rows values. The table
will be updated in the document, and if the document has already been sent to recipients, they will see the updated table
when they access the document.