Skip to content

Accumulation Get Item

Retrieves a single item from an accumulation at the specified index. If the index is invalid or the accumulation is missing the expected data, it returns None instead of failing.
Preview

Usage

Use this node when you have an accumulation (built by Salt list/accumulation nodes) and need to extract a specific element by its position. Commonly placed after building or transforming an accumulation to pick a particular entry for further processing.

Inputs

FieldRequiredTypeDescriptionExample
accumulationTrueACCUMULATIONThe accumulation structure containing an ordered collection of items. It must be a valid accumulation produced by related accumulation nodes.An accumulation containing items, e.g., a collection of images or texts.
indexTrueINTZero-based position of the item to retrieve. Negative indices select from the end if supported by the underlying accumulation.0

Outputs

FieldTypeDescriptionExample
itemWILDCARDThe item at the specified index from the accumulation. The type matches whatever is stored at that position (image, text, number, etc.). Returns None if not found.A single image, a string, a number, or None

Important Notes

  • Indexing: Uses zero-based indexing; negative indices are supported if the underlying list supports them.
  • Invalid access: If the index is out of range or the accumulation is missing its data slot, the output will be None.
  • Type propagation: Output type is dynamic (WILDCARD) and depends on the stored item; ensure downstream nodes can accept that type.
  • Input validity: Pass only valid accumulations produced by Salt accumulation nodes; other structures may cause errors.

Troubleshooting

  • Output is None: The requested index may be out of bounds. Check the accumulation length first using 'Accumulation Get Length' and adjust the index.
  • Unexpected type downstream: The retrieved item type may not match what the next node expects. Confirm the item type or insert conversion nodes as needed.
  • Errors with invalid input: If you see errors, ensure the input is a proper ACCUMULATION (not a plain list or dict) created by the Salt accumulation nodes.
  • Negative index not working as expected: Verify the accumulation contains a list-like structure. If needed, confirm valid indices via length and adjust accordingly.