I am having a little trouble with a process I’m developing. I need to take a user ID, name and email from a spreadsheet, and email the user. If a user ID is the same as the previous, the item in the spreadsheet needs to be removed. For example,
The row in red shows the same user ID as the one above it, so the row in red needs to be removed. How would I go about doing this? I am completely stuck, so any input would be helpful.
This works for one ID, but there are 200+ rows in my Excel Spreadsheet and when it repeats, it will only be two or three rows that have the same ID. I tried to use the remove duplicate rows activity and nothing was removed, and I’m unsure of what to use in the remove data row activity as I am unsure of what row numbers the duplicate rows are in.
This will copy the filtered rows alone to a new datatable, you have to use this in a Assign Activity. Then write the data back to the excel if you need.
Secondd option:
Creating a default view with distinct
@william.coulson
sometimes while readin Excel into Datatable some characters e.g. a blank on the end is transported as well. As its not remarked without explicit checking so this is quickly unknown.
However this leads to the sitation that some filter, distinct activities are returning a unexspected result.
have a try with this:
datatableVar.AsEnumerable.Distinct().CopyToDataTable (maybe will have same result)
For taking more control maybe this can be done (as a Variation to @sarathis125 GroupBy Approach)
I looked at the spreadsheets properly, it has taken out every row if the ID is a duplicate (that would work for the user you made a workflow for previously) but I need to keep one row of the duplicate IDs. For example, if there are three rows that contain the same ID, I would need to keep one, and discard two. Any ideas?
Resolved the issue myself. I used a long winded version instead that definitely works, which was installing Ablebits Suite Add-Ins the Ablebits website, and then using the attach window activity to attach the spreadsheet and use click and select item activities to merge the cells. Thank you all for your help, it has been much appreciated.