Yess.
Now got it.
Yess.
Now got it.
Excellent! If that resolves your problem, feel free to mark a solution here.
HI Ben,
After run the project in Debug mode below is the final status.
CurrentRow.Item(“Column5”).ToString should be TIER2 not TIER1
I would have expected CurrentRow.Item(“Column5”).ToString to be TIER1 for one of the rows, if you are still using the data from your first post. That shows that, for this column, row 1 is TIER 1, row 2 is TIER 2, row 3 is TIER 3. If you are using different data, we might want to revisit the column.
I believe its possible this error is coming because GCSR4 is null right there. I know at one point you had changed the write activity to an append. It might be worth looking into that again, and using append in the loop, and a final write outside.
Hi @BenZee ,
I am using same old data.
Whatever the data I will use in override dt, under column “Value” the data should be match with "GCSR1"dt. Thats I am thinking.
Now after the matching it should filter the dt under “Filter Wizard” and will update in the “Sheet3”
Now, can you please help me on this Filter Wizard.
Do you want the whole datatable to be filtered and added to sheet 3? Or only the rows that are true with those conditions we worked on?
not whole.
I only want to copy the matching data between Override dt & GCSR1 dt.
Override Dt is my main file. I will update there multiple Sales order and override name & value.
and, from the SAP, data is downloading in GCSR1 dt from same sales order which I have updated in Override dt.
Now BOT will compared both the sheet. which ever data will match between override and GCSR1 dt, BOT will filter in GCSR1 dt and write down in sheet3.
IF BOT filter on the sheet2 which is GCSR1 dt , I will be fine,
I hope you got my requirement.
If you can give me any VBscript which will filter the GCSR1 dt, thats also be fine.
After filter out on the sheet3 ,there si another activity I need to perform in SAP.
After that sales order will be save and move to next Sales order.
This process will go on in this way.
I am really appreciate your help so far. Please help me to complete this projeect.
Lets start with a method of adding each row that matches your conditions to a datatable. We can then use that datatable to write all of the rows at once to Sheet3, after the loops have completed.
Currently, your filter is adding all rows in your Override DT that match that filter every time your conditions are met. To change this to only add the rows that meet the conditions, try removing the filter activity and adding an “Add Data Row” activity instead. You can use the same output DT that you were using in Filter. For input, simply have “row” (or “currentRow” if you want to add from the other DT).
Finally, move the “Write range” outside of your loops and write the DT that you have been adding to to sheet3. That should get you what you are looking for.
One more thing to note. It looks like you could combine your “if” statements into one using “and”. This might make your workflow a little easier to follow. I’ve done that in the screenshot as well. Let me know how these steps work for you.
Might be that the DataTable you are trying to add rows to needs to be initialized.
This can be done in a few ways, but for this go to the variables panel, find the variable for your DataTable and add “new System.Data.DataTable” to the default field.
Which DT is the one being added to in the Add Data Row activity? Is it GCSR5? Can you take a screen shot of the properties of that activity? If it is GCSR5, add “New System.Data.DataTable” to that one. Override doesn’t need it, you can remove from that.
Ok,
Now I have added GCSR5 in “Add Data Row”. Let me try with this one.
Okay, if it won’t accept like that, try to change it so that Add Data Row uses ArrayRow (not DataRow) and do row.ItemArray. Screenshot below.
Yes, exactly. Make sure GCSR5 has default of New System.Data.DataTable.
Okay. Lets change default of GCSR5. Replace “New System.Data.DataTable” with “Override.Clone()”. .Clone should copy the Schema of the Override DT, giving you all of the same columns. Which should get rid of that error.