- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 10:55 PM
Is this a function that calls itself simultaneously?
I am concerned here with the syntax
We name the function and execute it directly without
transformEntry(); to need?
An using der Object Source?
answer = (function transformEntry(source) {
})(source);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 11:37 PM
that is the Self-executing function
A self-executing function is both declared and invoked within the same script field. Whenever writing a script that only needs to run in a single context, such as a transform map script, use this type of function. For functions that must run in multiple contexts, consider reusable functions instead.
answer is the OOB variable which is available and holds the value to be stored in the target field when used in field map script
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
09-14-2020 11:08 PM
Hello Meloper,
If you are facing error in code ,please share the code with us,to help you better.
Regards,
Yash Agrawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 11:13 PM
I only want to understand this function

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 11:29 PM
When you are mapping field in transform map .but you want to write code in field mapping at that time it will use that function,
in that function, it calculates the value and returns it in the "Answer variable".
so you can like access that value your "answer"
answer = (function transformEntry(source) {
// Add your code here, if the column name of incoming data is user then use source. user to get the value
return ""; // return the value to be put into the target field
})(source);
Please keep posted for more help.
Please Mark it helpful/correct if my answer helps in any way to resolve your query.
Reach out to me if any more help required.
Regards
Yash.K.Agrawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 11:43 PM
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 11:37 PM
that is the Self-executing function
A self-executing function is both declared and invoked within the same script field. Whenever writing a script that only needs to run in a single context, such as a transform map script, use this type of function. For functions that must run in multiple contexts, consider reusable functions instead.
answer is the OOB variable which is available and holds the value to be stored in the target field when used in field map script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader