Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to update multi records daily.

ESL
ServiceNow Employee
ServiceNow Employee

スクリーンショット 2023-01-25 22.33.24.png

Hello

 

I have some records which contain [cmdb_ci] field and [u_current_version] field.

I would like to update the [u_current_version] field for each record daily.  I am also using discovery to collect the latest [cmdb_ci] information, so I want to query the [cmdb_sam_sw_install] table to get the latest version field and update to my records.

 

I am trying to use flow-designer to update records but it is not able to update multi records.

Any idea to achieve this use case?  

 

Thanks.

 

1 ACCEPTED SOLUTION

Soeren Maucher
Mega Sage

Hello @ESL

 

If you want to update multiple records via Flow Designer, you typically have to loop/iterate over all the records you want to update. Therefore, you will need the following setup.

1. Get a list of records you want to update with the “Lookup Records” step
2. Create a “For Each” Flow logic in which you will iterate/loop over all records from the list
3. Add an “Update Record” Step inside the loop to update each record (here you could update the version in your case)

 

SoerenMaucher_0-1674659818047.png

 

In order to run this Flow daily you will choose a trigger type of “Daily” and can set the time at which you want the flow to execute.

I hope this helped. If yes, I would appreciate if you could mark this answer as "correct solution". Thank you!


Greetings,
Sören

View solution in original post

2 REPLIES 2

Soeren Maucher
Mega Sage

Hello @ESL

 

If you want to update multiple records via Flow Designer, you typically have to loop/iterate over all the records you want to update. Therefore, you will need the following setup.

1. Get a list of records you want to update with the “Lookup Records” step
2. Create a “For Each” Flow logic in which you will iterate/loop over all records from the list
3. Add an “Update Record” Step inside the loop to update each record (here you could update the version in your case)

 

SoerenMaucher_0-1674659818047.png

 

In order to run this Flow daily you will choose a trigger type of “Daily” and can set the time at which you want the flow to execute.

I hope this helped. If yes, I would appreciate if you could mark this answer as "correct solution". Thank you!


Greetings,
Sören

ESL
ServiceNow Employee
ServiceNow Employee

Hi  Sören

Thanks for your comment.

I did not think about using "For Each item" action.

It was a really good idea. 

 

Thank you!!!