I am using for each row in data table where under assign activity I am passing
Account=CurrentRow(0).to string
And then passing Account.toString in the application (which is working fine)
But, when I am trying to get the output in a CSV (not excel) it’s giving error
I am adding an assign activity
change = Account where change is arrey of string
Getting error
I am doing another For Each Row in Datatable
Can anyone suggest what should I do so that output CSV pastes multiple accounts after iteration
If anyone can provide a screenshot of xaml it will be more helpful,
1 Like
Anil_G
(Anil Gorthi)
February 22, 2024, 4:46am
2
@dipon1112000
you cannot assign a string to array of string
one way to assign is change = {account}
but not sure if this solves your other issues…the explanation is little off
if you have a datatable then dt
cheers
1 Like
I did the change now I am getting another error
1 Like
Anil_G
(Anil Gorthi)
February 22, 2024, 4:51am
4
@dipon1112000
looks like inside loop you modified the datatable.
not sure what you are trying to edit
you cannot add more rows to a datatable inside the for loop of same table
cheers
1 Like
Hi @dipon1112000
Try this in Assign Activity
Change = Change.Concat({Account}).ToArray
Hope it will helps you
Cheers!!
1 Like
@dipon1112000
Could you please provide the XAML file? Once we review it, we’ll have a clearer understanding of your requirements and can work on resolving the issue for you
1 Like
I am now getting an error
I don’t know what to do
The steps I performed are
Read CSV (datatable dt1)
Build Datatable (dt2)
For Each Row in Datatable
Get Row item (account)
Under for each row Added assign activity
Account= CurrentRow(0).toString
Type into activity (Account.toString)
Downloding pdf
Doing extraction with regex
All the activities are working
Now I am trying to get the extracted data to CSV (not excel)
So I am doing
Assign activity
Change= {Account} as I need to get all the account number used in the iteration
For Each Row activity under which I am using If condition
Condition is change.length=0
Under Then i am using 2 assign activity
Account= change(0)
Change=change.toArray()
Add data row
ArrayRow {Account}
Write csv
1 Like
@dipon1112000
Try this:
IF(Change IsNot Nothing,Change.Concat({Account}).ToArray,{Account})
Try the code provided by Nawazish Ahmad. It should work.
IF(Change IsNot Nothing,Change.Concat({Account}).ToArray,{Account})
1 Like
Tried now getting another error
I don’t understand why ? as dt1 is working when I am running Account.toString as I am able to open multiple pdf and do download.
But it’s failing when I am trying to get the iterated account.
Hi @dipon1112000 ,
‘Object reference not set to an instance of an object’ means that the variable you are using is null. Please check that your datatable is being read in correctly.
Hi @dipon1112000
Try below approach:
Build Data Table with DT2 (I have use here 3 Column only)
You Must Store your all value in some variables like below Plan, Price etc
In use Add Data Row Activity Pass like below
{Current Row(“Account”).ToString,Plan,Price}
** Pass all the variable with comma separated, in ArrayRow same number as DT2 build datatble column.
4. Use Write CSV Activity with Datatable DT2.
Hope it’ll helps you
Cheers!!
system
(system)
Closed
February 25, 2024, 8:34pm
14
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.