- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 02:40 AM
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!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2022 09:42 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 02:44 AM
Hi Anikta,
It's can achieved in mulitiple ways
- Data Policy
- Return Error if field is empty in the inbound Integration itself
Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 02:50 AM
Hi,
There is no direct way to handle this.
You will have to skip the record insertion if the fields are empty.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 05:00 AM
Hi Ankur,
Thanks for your response.
Could you please help with the Syntax/ sample code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2022 01:19 AM
Hi Ankita,
Check the below link similar question in answered
https://community.servicenow.com/community?id=community_question&sys_id=c98916efdbb174d4ae03d9d968961928
Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,
