Invoke Code - Assign code during runtime

Can the Code for the Invoke Code activity be assigned during runtime? The description of the activity here states

  • Code - The code that is to be invoked. This field supports only strings and String variables.

I interpret this to mean that I could assign the code to a String variable and pass it to the activity. However, it does not appear that can be done. My goal is to place a file in our storage bucket with the C# code I wish to run when the automation runs.

@joe.foster

Ideally you cannot pass liek that…because the code needa to be compiled first…

Also why do you want to pass the code dynamically?

Cheers

To be able to modify the code without redeploying the entire package.

When you say modify the code what do you mean? You can pass arguments into the Invoke Code activity, and those values can come from variables that you can then use in the code. For example, if you want to multiply two numbers you pass those in as arguments NumOne and NumTwo and then your code is “return NumOne * NumTwo” - but if you want to change the code to doing division instead of multiplication, you can’t. You’d have to have another argument “operation” and then do “if operation = ‘division’ then return NumOne/NumTwo else if operation = ‘multiplication’ then return NumOne * NumTwo”

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.