Error: Cannot read property on flow Action

JRY
Mega Guru

Hello Team,

I'm trying to test flow but I don't know why I'm getting this error because of this it's not creating ScTask

find_real_file.png

find_real_file.png

 

find_real_file.png

find_real_file.png

find_real_file.png

 

Can anyone help me what is the issue.

Thanks,

JRY

 

1 ACCEPTED SOLUTION

Chaitanya Redd1
Tera Guru

Hi,

Could you please run the script below and test it? Please let me know if you require any other assistance.

(function execute(inputs, outputs) {
var temp = inputs.ADAccount.split('\\');
if(temp.length != 2){
outputs.success = false;
outputs.errormessage = "Malformed lan id provided";
return;
}
var domain = temp[0];
if( domain.indexOf('.') >= 0 ){
domain = domain.split('.')[0];
}
var filter = "TechCode eq ('NT') and SubPlatCode eq (null) and PlatCode eq ('" + domain + "') and UID eq ('" + temp[1] + "')";
var iamAPIUtil = new IAM_API_Utils();
var response = iamAPIUtil.getAccountOData(filter);
outputs.success = true;
outputs.ownerxomguid = JSON.stringify(response.value[0].ownerxomguid).replace(/\D/g, '');
//gs.info(response.value[0]);
})(inputs, outputs);

 

If my answer helps anyway please mark it helpful.

 

Regards,

Chaitanya

View solution in original post

11 REPLIES 11

try to debug

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

Chaitanya Redd1
Tera Guru

Hi,

Could you please run the script below and test it? Please let me know if you require any other assistance.

(function execute(inputs, outputs) {
var temp = inputs.ADAccount.split('\\');
if(temp.length != 2){
outputs.success = false;
outputs.errormessage = "Malformed lan id provided";
return;
}
var domain = temp[0];
if( domain.indexOf('.') >= 0 ){
domain = domain.split('.')[0];
}
var filter = "TechCode eq ('NT') and SubPlatCode eq (null) and PlatCode eq ('" + domain + "') and UID eq ('" + temp[1] + "')";
var iamAPIUtil = new IAM_API_Utils();
var response = iamAPIUtil.getAccountOData(filter);
outputs.success = true;
outputs.ownerxomguid = JSON.stringify(response.value[0].ownerxomguid).replace(/\D/g, '');
//gs.info(response.value[0]);
})(inputs, outputs);

 

If my answer helps anyway please mark it helpful.

 

Regards,

Chaitanya