Script

Provides a way to execute C# script.

Revision History

2.1.0.12 [.Net Framework v4.5.1] - Fixed bug on the AdditionalAssemblyPaths
2.1.0.16 - Fixed null reference bug when migrating to the 23 Refresh

Properties

Connection

Type: Connection Input
The Connection Property

DropPoint

Assign a DropPoint to the Connection when the script needs to access on-premises resources, such as the local file system, which is not accessible in-cloud.

AdditionalAssemblyPaths
Type: Multiline Text Input

If you need to use reference specific .NET assemblies (.DLL's), specify the path to each library in this Property, placing each on a separate line.

Refer to the example below to ensure the assembly paths are added in the correct structure.

C:\path_to_file\first_custom_reference.dll
C:\path_to_file\second_custom_reference.dll

Script

Type: Multiline Text Input
Provides a C# script to be compiled and executed.
Do not adjust the namespace, class name or Process method signature. Make sure to place your C# code inside the Process method body or add additional methods to the class.

See Example below:

using System;
using System.IO;
using System.Collections.Generic;
using System.Xml;
using System.Linq;
using System.Xml.Linq;
using Newtonsoft.Json;

namespace CSharpScript
{
    public partial class Processor
    {  
        public object Process()
        {
            //Enter your code here...
            return null;
        }
    }
}

Value

Type: Object Output
The Value Property returns the result from the defined Script.

Custom Properties

Adding additional input and/or output Custom Properties causes C# code properties to be declared.

Remarks

Use the Script Node to execute arbitrary C# script when no suitable Node is available or deriving the equivalent process via a series of Nodes is not desirable. As use of scripts trades off readability for throughput, it's usually recommended that it is avoided when the same behavior can be achieved using other Nodes.

Note that line numbers reported in error messages may not be exact. This is due to the way the script is compiled internally.

Examples

See Sample Workflow for an example.

See our Github Sample for a project that will help debug the Node.

See Also

Expression
Variable Bar