Function [native code, arity=0] while trying to pass current variable into PowerShell activity

aaronliprime
Tera Contributor

I'm trying to pass a select box variable from a catalog item into a PowerShell activity but it's coming out as this:

function size() {
    [native code, arity=0]
}

Google says this usually happens when you forget the () after a method call except I don't have any of those:

workflow.info(current.variables.size);
if(current.variables.size != "other"){
    workflow.scratchpad.size = current.variables.size;
} else {
    workflow.scratchpad.size = current.variables.custom_size;
}
workflow.info(workflow.scratchpad.size);

Both of the workflow.info are returning the expected value.

The weirdest thing is it runs perfectly fine when I personally test it, but it doesn't work for anyone else. What could possible be causing this?

4 REPLIES 4

amaradiswamy
Kilo Sage

The weirdest thing is it runs perfectly fine when I personally test it, but it doesn't work for anyone else. What could possible be causing this? // I think this will happen when workflow checked out by you is not published. Publish the workflow and it should work for everyone.

I checked and it is published so it's not that. Thanks though!

aaronliprime
Tera Contributor

As best I can figure for some reason when I pass ${workflow.scratchpad.size} into the activity input it's taking .size as a method instead of a property and then bugging out that it doesn't have (). The same activity has 16 other inputs configured the same way and all of them are working fine.

May be you can convert the value to string while assigning to scratchpad and try with a different variable name

var val = current.variables.variable_name;

workflow.scratchpad.sizeval = val.toString();

 

and pass ${workflow.scratchpad.sizeval} in custom activity