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

VaranAwesomenow
Mega Sage

Looks like JSON doesnt have that element, is the split logic correct, it says '\\' shouldnt it be '\' ?

Hi Anil,

I've done the changes you advised, but I'm still getting this issue on Input. I think there is no problem with Input.

find_real_file.png

I think below highlighted part is getting error.

find_real_file.png

Thanks,

JRY

Hi @Ankur Bawiskar ,

 

Can you help me on this one.

Thanks,

JRY

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Did you check what you got in response.value[0] object since you are getting value from that?

try to add gs.info() and share the details

Regards
Ankur

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