Save data into an array provided by the user

I want to save info into an array full of int32, that info should be provide by the user so I create this


I want to then change that namber with the variable

Hi @rodriordu123 Create a variable Input of type Array of int32. Now, take assign activity

Input(0)=123

Below workflow for reference

SampleProcess.zip (2.4 KB)

Use list instead of array. You can modify list

What activity are you using to “Save To” the array?

Assign activity

I have the array in int32 but if I add the “” will make the add data a string

@rodriordu123 That looks very unfamiliar. Are you using StudioX? If so, you should change the post tag from Studio, to StudioX, as the interfaces and techniques are VERY different.

Hi @rodriordu123 ,

Maybe using a List would be better off than using an Array for this, However using an Array we can follow the below :

  1. Initialise the Array
IntArray = new Integer(){}
  1. Append the value to the Array
IntArray = IntArray.Append(1).ToArray

Implementation :
image

Debug Panel :
image

No it can’t work that way.It will show an error. If you want pass number then you use the variable of type Array of Int32, if you want to pass the string values then var of type Array of String. Check the above attached workflow for ref

I am using Studio

I use the file that you send me but stil have the same error than I had

I assume that your array is empty so you cant assign to first element value 1 because first element doesnt exist. With empty list you would be able to add value, edit value or remove value. Use invoke method

Can you show me wich list variable should I use

Can you share the screenshot of your variables panel (var where you defined)

@rodriordu123 Remove the (0) from Input, then change value to save to {1,2,3}. At least I think. You may be using Studio, but that Assign activity pictured is a StudioX activity.

@rodriordu123 Check the updated workflow below

SampleProcess.zip (2.4 KB)

I create the empty list how I fill it with data given by the user

You can find a lot of topics how to do it. Use search :slight_smile:

Here is example

@rodriordu123

Create a list of int32 …then use append to list activity

You can pass the variable/value to append in the value to append field and the list variable in the list field…can select type argument as integer

Cheers