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. Ensure that the collection ID is correct to avoid saving data to the wrong collection.

ID
stringRequired

The ID of 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

Additional fields to be saved with the document. These fields can include various data types and are optional. The default value is an empty list.

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 particularly useful for persisting data that can later be retrieved or used in other parts of the workflow.

Best Practices

  • Ensure the collection ID and document ID are correct and match the intended collection and document to prevent data from being saved to the wrong location.
  • Use Jinja templating in the text and id fields for dynamic content generation based on the workflow state.
  • Validate fields to match the collection schema to prevent errors during document saving.
  • Handle exceptions gracefully to ensure workflow stability in case of network or service issues.