How do I modify records with a ForEach loop?
Comments
-
While the Update Entity step can be used to modify the 'Item' entity in a ForEach loop using the Item.ID as the reference, this step is considered deprecated and is no longer recommended.
You can instead use a 'Save Entities' step by setting the 'Entity' input to 'Build Data'. For the fields you don't want to update, map these inputs to their corresponding fields on your ForEach Item's fields, then map in the new value to the field you want to update.
In the example screenshot below the flow creates a new list, fetches all objects for my data type, then loops through them changing the 'Name' field to a new random name with the 'Save Entities' step.
Please note the 'Save Entities' step overrides all fields, so if any are set to 'Ignore', they will be overwritten as 'Null' in the database, so be sure to map in values for all fields you want to retain.
(The Item ID is required to save the entity and it can't be changed.)
For more information on the Save Entities and Update Entity steps, please see the below documentation pages:
https://documentation.decisions.com/step-library/docs/save-entities
(Deprecated) https://documentation.decisions.com/step-library/docs/update-entity
Howdy, Stranger!
Categories
- 4.2K All Categories
- 67 General
- 11 Training
- 202 Installation / Setup
- 1.1K Flows
- 106 Rules
- 262 Administration
- 212 Portal
- 490 General Q & A
- 695 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 52 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 179 Pages
- 5 Process Mining
- New Features
- 179 Datastructures
- 69 Repository
- 221 Integrations
- 28 Multi-Tenant
- 27 SDK
- 78 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 83 Lunch And Learn Questions