Hi @sudhanshu31,
You have the input in one string. Thats fine. You have to split the whole string based on some feasible separator, may be space as @akhi_s27 has suggested.
Next thing, after splitting you will get the output in one Array.
Implement one for loop to iterate through the array values.
By fetching one by one values and storing in different variables.
Use Add Data Row activity and pass the multiple variables like this: {Value1,Value2}.
Thanks! That’s work partially, as now I am able to get separated items in my object variable, but I am getting output in excel as system.string when I trying to add data table. Please help,
@rk.sati
The For each activity has a Type Argument parameter that is defaulted to Object, I believe. You will want to change that to “String” since each “item” will be a string from your array.
Then you can put a string Variable in the left side of the Assign activity to store the item into or do other activities with that value.
Typically, I wouldn’t store them in individual variables (since there are so many) cause you can access each item from the array.
For example,
DTarr(5) would give you the 6th item using index of 5
It also depends on what you need to do with the values. If you need to store them into a spreadsheet then there are few ways to do that also. Like, if you create a datatable either by making a new one or Read Range, you could do “Add Data Row” and put DTarr array into ArrayRow parameter.
Then, at some point you use Write Range to output the datatable to the spreadsheet.
Thanks!
Initially I tried it using my DTarr which of array type into add data row(array row as {DTarr}) but that is giving output in excel in a single cell.
So I split that using tab. But after splitting when I am using in my array row, it is giving output in excel in a cell as System.String.
That is why I am thinking of storing each split item in different variable or array variable, but don’t know how.
Do you have a screenshot or example so we can see the activities you are using and the parameters? You should have a datatable that stores the items into each column (with Add Data Row) so you can look at values before you output it to Excel. Then, Write Range will output the datatable to the sheet.
The ArrayRow parameter should be just DTarr with no brackets. When you do the split it is already an Array so no need for brackets.
Ooops! removing single {} brackets makes all difference. It is working perfectly fine now after removing those bracket. Thanks a ton!
I tried many ways and spent 1 day… Thanks a ton!