Home > Forum > Actions > Update all items in item list

Update all items in item list
0

Hello,
I've just come accross a slight problem with updating an item list. I have a list of items (emplayee, year, number of days available). The list is being initialized at the registraton step with all the employee names (70 rows). I've also created seperate attribute fields for year and number of days and would like to type let's say "2022" in the year field (the separate one outside the list) and clone it to all the items on the list. The "update item list action" requires a unique ID of row to be updated, but on the registration step the item list is not in the WFElementDetails table yet (I guess...), so I can's get row ID's. I've tried adding a technical field with value of '1' to the list and making it the key for the update (I thought that if all the rows have the same value and I indicate it as the key, all the rows with this value will be updated, but no, it does not work this way, only the first one is being updated).
So how can this be achieved?

MVP

Hi Michał,

I would have guessed, that the Id already exists, even if it's only available in the current transaction, but I haven't tested it.

I always use a similar query like in the attachment
select DET_ID
, 'Value' as ColumnToBeUpdated
from WFElementDateil
where DET_WFDID = INstanceId
and DET_WFCONID = ID_of_ItemList_Attribute(field)

If this doesn't work for some reason, you could also change the Unique value (1) to a different column. For example the column containing the employee.

If it still fails, could you post your query?

Best regards,
Daniel