How to store variable value into array?

Hi guys, I am trying to store a variable value in an array for later use. First I have a string variable known as Price, then I have an array of PriceList. I want to store the value of the Price in the Pricelist. Then I need to get the lowest value in the PriceList. May I know how can I do this?

Note: The Price needs to be a string value, cause I need it to be a string variable for database insertion. For the PriceList what type should it be? String or Double?


Hi @hjie30

Before adding it to the price list, convert the price string to double and then add it to the price list of type double. Then you can get the maximum of price value.


If you want to add multiple values better use list rather than array as array is static…

For list you can use append to collection to add data…

And once everything is added

Listvar.Max(function(x) cdbl(x)) will give you the max value


1 Like

Hello @hjie30
Try this

  1. If you need to get the value in int, set price list variable as a Array of integer.
  2. While concat, use cint(Stringvariable)
  1. Then to Get the lowest value use

to Get the lowest value use


To Join value


  1. If you need to get the value in double, set the price list variable as an Array of Double.
  2. While concat, use cdbl(String variable)


Further to @Anil_G’s post.

Take a look at this video from Anders Jensen.

May I know why am I having this error? Is it because my pricelist initially is empty?

Hi @hjie30 ,

You would need to initialise the PriceList array variable in the below manner first :

PriceList = new Double(){}

Also, Would suggest to use Append, so you wouldn’t need to add the data as an array if each time a single data is being appended to the list :


Let us know if you are not able to get the output.

Do you have anything the Pricelist before? @hjie30

If not you need to initialize that variable first




I am not able to use append here, is it because it is an array of double type? How to I change from array type to list type? I never use list before in UiPath


Try removing the double curly braces {} and try again?



This is what happened after removing the curly braces

Actually, it works well using the Concat instead of Append, actually what’s the difference between this two?

Not there @hjie30

In the below expression

Append({Cdbl}) from here remove {}

Kindly Refer to this Xaml file, You may get some idea
Array_Append.xaml (7.7 KB)

Thank you very much, it works

1 Like

Sure thank you, I will take a look.

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