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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 06:08 PM
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?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 06:47 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 06:53 AM
I checked and it is published so it's not that. Thanks though!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 06:57 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2020 08:58 AM
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