Hello Folks,
I am in a situation where I have to iterate record list from an excel. I need to do some validation before I successfully upload the excel records in my system.
One of the validation I have to do from excel is to check if there is any duplicate in any rows in the excel so that I can through an error in the corresponding row. For example one of the columns in excel has value "Evil" and the same value again repeats in row 6 and row 9. So I want to show same error message in all three column.
Attached is the screenshot of the table what I want to show on front end. In my current logic I am only able to show error message in the last column but I want to add the same error message in both first and last row.
Looking forward to the answer to this problem.
Thanks.
Hi, Anil Kumar
Please find the attached OML file for your solution. The above screenshot shows the expected output. Kindly confirm if it is correct.
Hi Sowmya,
Thanks a lot this is exactly what I was looking for thank you so much for the help.
Cheers!
Hi @Anil Kumar,
Try to use ListDistinct system action to remove duplicates from a list.
Thank you.
The problem is I want to show error message first on the screen in each repeated row. Not just removing the duplicate.
You'll need to implement a two-pass validation approach to properly show an error message.
Hello.
There are two actions you can use for this.
ListIndexOf to find the first.
ListFilter to find how many repetitions.
I attached an example with both so you can see how to use them.
Just a warning: you can't use them over the list you are iterating, but you can use a copy of the list, or use the source as is and create a new list with the extra info, or just do an ad-hoc loop.
Thank you so much Nuno.
This approach also solved my problem.
Dear Anil,
If your data is coming from an Excel sheet, you can simplify the entire process by using the Advanced Excel component. You can add an Excel formula directly within the sheet to flag duplicates before converting the data into records in your application.