How to pass the object values through script include for the flow designer servicenow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2024 02:10 AM
I have created one action in which I have an input as array object. In that array object, I have another object.
I want to pass the value through script include. But, everytime the value is returning as [object object] in the logs.
createInvoiceLine: function(invoiceLinesInput) {
var invoicelines = [];
if (typeof(invoiceLinesInput) == 'string') {
invoiceLinesInput = JSON.parse(invoiceLinesInput);
}
for (var i = 0; i < invoiceLinesInput.length; i++) {
var invoiceLineJson = {}; /
if (invoiceLinesInput[i]["account"]['code']) {
invoiceLineJson["account"] = {
"code": invoiceLinesInput[i]["account"]['code']
};
}
invoicelines[i] = invoiceLineJson;
}
return invoicelines;
},
this is the code I am using, but it is not returining proper value passed through an action - [Object object]
Any help will be appreciated
thanks & regards
Nayan
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2024 01:52 PM
Please check this KB.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0818526