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.1K All Categories
- 60 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions