Variable type for Array

I am building a for each loop so that the automation can do the same activity for a number of inputs, separated by a comma. For example “dog,cat,elephant”. It will go through the steps and enter dog, go through the steps again and enter cat, etc.

I am using the Assign activity to create a variable “RuleArray” with CurrentRow(“Technical Object Remainder List”).ToString.Split(","C) as the input. I currently have the variable type as “String” and am getting the following error:

"Compiler error(s) encountered processing expression “CurrentRow(“Technical Object Remainder List”),.ToString.Split(”,“C)”. Value of type ‘1-dimensional array of String’ cannot be converted to ‘String’.

What type name from the above screenshot should I search for? I have tried a number of different types of strings to no avail as of yet.

Thanks in advance.


You don’t need to do this. Just put the Split expression directly into the For Each activity.

Anyway, your variable would need to be array of string, not string.

theoretically yes, encountered enough exceptions when the for each will act differently
But agreeing on the alternate:

  • place it directly, reduce amount of variables, set typeargument to string manually

However, it is always good to know, how to select an Array(of X) type

Hi @tp39165

I think it was the two dimensional array. Change the variable datatypes to two dimensional array.
Follow the below steps -
=> Open variables panel
=> Select the array of string variable that you are getting error.
=> When you select array it was to take string,int, array, browse for types.
=> Again click on array then we have to select the string from the datatype.
=> Then save it will be two dimensional array.

Hope it helps!!

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