Skip to main content

Using Array Variables

An Array is a variable type that can store a collection of elements of the same data type. The Array can be created by arranging multiple instances of objects, strings, numbers, or boolean values. Refer to link for more details.

Variable Pane

Note:

  • An Array is a variable type that can store a collection of elements of the same data type. The Array can be created by arranging multiple instances of objects, strings, numbers, or boolean values. Users can choose different variables for the Array, as shown in the above figure.

  • Traversing through an array is done using an index. It is a zero-based index. Suppose Array of fruits ={ apple, orange, banana, grapes;} it means Apple is at zero indices.

  • Example for creating a new array of String

  • Iterate through the array items using index aSubjects[0], aSubjects[1] etc

  • Create two-dimentional array

Let us understand the Array variable with an example process. Here is an example that takes two subjects' scores out of 100 and displays the total marks and percentage. Store the subject name as an array of String.

Come, let's create this process in Process Designer:

Step#1

Launch and create a new process in Process Designer

  • Launch Process Designer from the Windows Start menu located under IntelliBuddies Enterprise

Step#2

Create New Process

  • Click on New Process and fill in the new process details

Step#3

  • Add variables to hold the marks, total, and percentage.
  • The array of String holds the subject name, as shown below.

Step#4

  • Add For Each by setting type as String.
  • Iterate through the string array of the subject name.

Step#5

In Activity panel search for Input Dialog

  • Drag and drop Input Dialog activity into body of For Each.
  • It takes the marks as input and sets them to an int variable.

Step#6

  • Compute and assign the total and percentage of marks entered.
  • Display the total and percentage of marks entered in the output window using Writeline.

Step#7

Save the process

  • From the Design tab ribbon, click on Save

Step#8

Run the process

  • From the Design tab ribbon, click on Run

Step#8

Make sure the process executes and pops up input dialogs. Enter the number and click on Ok. Then in the output window, total marks and percentages are displayed.

Download Example (C#)