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 stop updating in transform map field mapping on certain conditions

Raviteja Kunal1
Tera Expert

I have a use case where data will be coming from SAP in three rows and if any of the rows having a value in field called block we need to set the value blocked = true in target table field. But I am facing an issue like, if one row updated value to blocked = true and later another row making the value to false again. How to fix this issue in transform map.

 

Thank you.

8 REPLIES 8

Anantha Gowrara
Kilo Sage

Hi @Raviteja Kunal1 once you are updating blocked=true just return out of loop something like below

if(source.field1 == 'block' || source,field2 =='block' || source,field3 =='block'){

target.blocked=='true'

return;

}

 

thank you @Anantha Gowrara but if another row in the staging table is not having any values it is updating as false again.

Anantha Gowrara
Kilo Sage

@Raviteja Kunal1 can you share your code once

Raviteja Kunal1
Tera Expert

RavitejaKunal1_1-1728317628009.png

This is how I am writing in field map.