Save Document to Collection Block

Save documents to Scout collections

The Save Document to Collection block enables users to store documents within a specified Scout collection. This block is essential for workflows that require saving data securely and efficiently, with support for dynamic content through Jinja templating.

Configuration (Required)

Collection ID
stringRequired

The ID of the collection where the document will be saved. Ensure that the collection ID is correct to avoid saving data to the wrong collection.

ID
stringRequired

The unique identifier for the document. This ID is crucial for distinguishing between different documents and for updating existing ones. This field supports Jinja templating for dynamic content generation.

Text
codeRequired

The main content of the document to be saved. This field supports Jinja templating, allowing for dynamic content generation.

Values
list

A list of fields with their types and values, supporting Jinja templating for dynamic content. These fields can include various data types and are optional.

See Workflow Logic & State > State Management for details on using dynamic variables in this block.

Outputs

The block outputs a response from the collection service after saving the document. This response confirms the successful storage of the document and provides any relevant feedback from the service.

Usage Context

Use this block to store data into Scout collections from within your workflow. It is ideal for applications requiring dynamic document creation and updates.

Best Practices

  • Ensure the collection ID and document ID are correct to prevent data from being saved to the wrong location.
  • Use Jinja templating in the text and id fields for dynamic content, allowing for flexible and adaptable document creation.
  • Validate fields to match the collection schema to ensure compatibility and prevent errors during the saving process.