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.

Making field mandatory for inbound integration

Ankita9
Tera Contributor

Hi,

How can we make below fields mandatory for an inbound integration?

Record should be created only if below fields have validate data, Please suggest.

Mandatory Fields: 
1. Display Name
2. Full Name
3. Source Identifier
4. CI Source
5. Status
6. Criticality Classification
7. CI Owner Group 
8. Support Group
9. Approver Groups 
10. HA Configuration 
11. Environment
12. Install Status
13. Description
14. Class

 

Thanks in advance!!

1 ACCEPTED SOLUTION

Hi Ankita,

If you are using scripted REST API and have shared that endpoint; you can check this link where I have shared solution

Return Error Message for missing Mandatory field via Scripted Rest API

OR

if you are using import set API then you can use onBefore transform scripts; you can ignore that row

something like this

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	if(source.u_field1 == '' && source.u_field2 == '' && source.u_field3 == '')
	{
		ignore = true;
	}

})(source, map, log, target);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Hi Ankita,

If you are using scripted REST API and have shared that endpoint; you can check this link where I have shared solution

Return Error Message for missing Mandatory field via Scripted Rest API

OR

if you are using import set API then you can use onBefore transform scripts; you can ignore that row

something like this

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	if(source.u_field1 == '' && source.u_field2 == '' && source.u_field3 == '')
	{
		ignore = true;
	}

})(source, map, log, target);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader