Data Memory
This function block keeps a value in memory and optionally updates it when requested. It is useful for preserving the last known data across runs or for freezing a value until an explicit update is provided.
π₯ Inputs
Generic General input data to store in memory. Can be any data type (numbers, text, image, lists, dictionaries, etc.).
Update Data Boolean input that controls whether the incoming data should replace the stored value.
π€ Outputs
Generic The currently stored value. If never updated, this may be empty/None.
πΉοΈ Controls
This block has no additional UI widgets. Behavior is controlled by the two sockets listed above.
π― Features
Persistent in-flow memory: holds a value across evaluations and only changes when
Update Datais true.Accepts any data type on the
Genericsocket.Simple freeze/unfreeze mechanic: set
Update Datato False to freeze the stored value, True to allow updates.
π Usage Instructions
Feed the value you want to keep into the
Genericinput.Toggle
Update Datato True when you want the memory to accept the new input.Set
Update Datato False to freeze the stored value; the block will keep outputting that value until an update is allowed.
π Evaluation
On each evaluation the block checks the Update Data input. If True, it stores the current Generic input and outputs it. If False, it outputs the previously stored value unchanged.
π‘ Tips and Tricks
Use with
Is Noneto detect missing inputs before writing into memory, keeping the stored value safe from accidental None overwrites.Pair with
Replace Noneto provide fallback data when the input is empty, then control writes withUpdate Data.Combine with
Data Read Local/Data Write LocalorData Read Global/Data Write Globalfor more persistent sharing between different parts of your flow.Use alongside
Debug Inputto log stored values during development and verify when memory updates happen.When processing batches, coordinate with
Batch Processing,Get Batch Size, orBatch Concatenationto control whether memory should store whole batches or individual elements.For logging or export scenarios, feed the block output into
CSV Export,Image Logger, or other export blocks to record the preserved data only when a confirmed update occurs.
π οΈ Troubleshooting
If output never changes, ensure the
Update Datainput is being set to True when you expect an update.If stored value becomes None unexpectedly, check upstream blocks for None outputs and consider using
Replace Nonebefore writing to memory.If multiple areas of your flow require the same value, prefer the read/write local/global blocks to avoid duplication and ensure consistent updates.
Last updated
Was this helpful?