How to Set field values of multiple records at a time by using ATF

Community Alums
Not applicable

Hi all,

 

We are having bulk of records to only field value have to be set same for all the records.  Suppose there are 10 records "COUNTRY CODE" field have to fix "IN" all records by using ATF. 

nazma786allah_0-1694436802826.png

I tried in below way but here we have to update each record. 

nazma786allah_1-1694438083646.png

 

 

My requirement is to set multiple records at a one time. Is there any possible in ATF. Hope if server side script in ATF will help please send me script with procedure. or without script it would be great.

 

Please suggest what steps needs to be added.

 

Thank you,

Naz Shaik

 

6 REPLIES 6

Mark Balloch
Giga Contributor

In ServiceNow, you can use an Application Transformation Framework (ATF) test to update multiple records with the same field value simultaneously. Here's a step-by-step guide on how to achieve this without the need for server-side scripting:

  1. Create a New ATF Test:

    • Navigate to "Automated Test Framework" > "All" > "Create New Test."
    • Give your test a meaningful name and description.
  2. Define the Test Steps:

    • Click on the "Define Test Steps" related link.
    • In the Test Steps form, add a new step:
      • Action: "Update Existing Record" (This action allows you to update records).
      • Table: Select the table where you want to update records (e.g., the table containing the "COUNTRY CODE" field).
      • Conditions: You can filter the records you want to update by adding conditions here. For your case, you can add a condition like "COUNTRY CODE is empty" if you want to update records where the "COUNTRY CODE" field is empty.
      • Set Values: In the "Set Values" section, specify the field you want to update, which is "COUNTRY CODE" in your case, and set the desired value, which is "IN" in your example.
  3. Save and Close:

    • Save the test step configuration and close the form.
  4. Run the Test:

    • Back on the main ATF test form, click "Run Test" to execute the test.
  5. Review and Confirm:

    • The test will identify and update the records that meet the conditions you specified.
    • Review the results to ensure that the desired records have been updated correctly.

By following these steps, you can use ATF to update multiple records with the same field value without the need for server-side scripting. This approach allows you to define conditions to specify which records should be updated, making it a flexible and automated solution for mass updates in ServiceNow.

Community Alums
Not applicable

Hi Mark Balloch,

 

Thanks for your response. I tried this way but the field values are not getting populated when updating the record.

 

I tried below way

Step1- navigate to module

Step2- add filter to list 

Step3- update record

 

Run test- successful but why field values  not getting updated. Your response is greatly appreciated

Shaqeel
Mega Sage

Hi @Community Alums 

 

It can be only done by updating each record one by one through ATF.

You can not update all at once.

 

Regards,

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

Community Alums
Not applicable

Hi Shaqeel,

 

Thanks for your response. I hope by using "run server side script step" will work for this requirement. Can we update records  by the script  or not.