Advent Challenge #5

Advent Challenge #5 | Advanced | C#

Santa is annoyed at Jingle Bell, but he is a Maradona fan. To honor the Football Great and get hi attention, Santa invokes the ‘divine free-kick’ of NAPOLI vs Juventus 1985 and kicks the file into the \incoming folder of Santa_Stream

The Football great maneuvers the files and unzips them into the \Wish folder. The idea here is to untangle the files to clear up Jingle Bells mess . Diego needs all the expertise he put in at NAPOLI vs Lazio in 85.

And as unique as Maradona’s magic is, each unzipped folder gets a unique ID

The football great navigates through the mess in the files and dedupes them - 2 files are not a problem because he beat 4 Belgians to score an awesome goal for his team during ARGENTINA vs Belgium 1986 World Cup

As the final act, the Great Master scores the ‘Goal of the Century’ of ARGENTINA vs England 1986 World Cup to kick the Deduped File into the \outgoing Santa_Stream folder !!!

Santa got his wish of getting all of the Wishes deduped! :smiley:


With this code, hopefully Santa can do it himself the next time.

UiPath_Advent2020_Advanced5_CSharp_rpavanguard_Maradona_Style.xaml (20.2 KB)


:snowflake: Beginner:

Santa booked his ticket for the cricket :cricket_bat_and_ball: :cricket_bat_and_ball:match and very eager to see watch the “Boxing Day” test match between India :india: Vs Australia :australia: on 26th…When he opened the ticket zip he got two tickets so he has to delete the recently booked ticket.


Let’s use dictionary to solve this problem… :wink: :rofl: :sunglasses:

Here you go Santa, Duplicate ticket has been deleted…

Santa is dreaming about watching the match

XAML: (63.0 KB)


Advanced Challenge 5

Santa! We heard you have some problem so we came here to help you, even if it’s winter!

Ok… we are a little scared by the temperature, but we’ll get into work right now!

The first step is to unzip the file and extract the data from the Excel…done!

So, now the hard part…we have to merge all this data and check the rows one by one? You’re kidding, it will take a lot of time, and we like to go fast!

With the help of UiPath activities we are able to merge all the informations in just one file

Lastly, we have to create a new Excel and write the Data, but with a little bit of Jamaica inside!


So we did it!

See you later Santa, and don’t forget to come to Jamaica, even if it’s not your ideal climate!


AdvChallenge5.xaml (9.7 KB)


Hello Santa it would help you to delete the latest created file begineer5
this flow help you to delete the duplicates in two files and give the resultAdvance5
begineerAdvent5.xaml (12.0 KB) excel.xaml (6.0 KB)


Santa is all excited to deliver kids gift and he just realized the mess and need help in choosing the right file from below

Santa need not worry, UiPath can find an easy solution.
Approach used: Iterate through the folder, compare FileCreatedDateTime and store the file to be deleted.On loop exit delete the file.
Here is the execution result
Santa is very happy and have now time to go for a match
Below is the code
Challenge5.xaml (8.7 KB)


Panic in Santa Inc. :scream: :scream: :scream:


Hey Jingle-Bell,

I will help you on the versioning before Santa heard. We’ll got it :wink: :wink: :wink:


First let’s take a look at out files and the creation times.

After that with a magical LINQ, we get the latest created file


And destroy it

The full workflow with the output:

image (57.0 KB)


Read all the files in the input folder and merge them all!


Removing the duplicate rows


:tada: :tada: :tada: And here is your final wish list! :tada: :tada: :tada:

image (70.3 KB)



As the year draws to an end, Santa’s football team, “The Eleven Elves”, faces off against Easter Bunny’s team, Bucktooth FC.

However, things don’t look very good. It is minute 89’ and Santa’s team is 1-0 down, thanks to an own goal by his defender, Jingle Bell.


Beginner challenge

However, Santa’s team wins a free-kick on the edge of the box. Santa brings in his power substitute Ronaldinho.

As the coach, Santa explains to him that a weakness needs to be found in the bunnies defense. One among the two of the Bucktooth central defenders is older, and Ronaldinho needs to float the freekick next to him so that one of Santa’s elves can head the ball in.

Ronaldinho racks his brain and recognizes that to find the older defender, he need to invoke a .NET query:

With utmost focus, Ronaldinho takes the free-kick:

The tactic works! The elves are level. The score is 1-1 and the game goes into extra time.

Advent Challenge 5 - Beginner.xaml (7.7 KB)


In extra time, team Santa wins another free kick. This time, Santa notices a weakness in the rabbits’ wall formation. There is some duplication in their player marking, which creates a defensive weakness. If only the duplicate can be found out, Santa’s team can convert the second free-kick as well.

Ronaldinho comes up with another master-stroke - a simple query that eliminates duplicates from a datatable.


With this insight, the Brazilian wizard steps forward to take the kick.


The crowd goes wild! Thankfully, Santa’s team clinches the game 2-1. Thank god for Ronaldinho’s two queries. It would have been embarrassing to lose a home game in the Christmas season.

Advent Challenge 5 - Advanced.xaml (9.3 KB)


:fire: Advanced:

This time Santa ready to swing his tennis racquets and decided to play with the kids…And he had planned to share the gifts after the tennis match…

Santa decided to play :two: sessions and One in the morning :sun_with_face: and one in the evening. :sun_behind_large_cloud:.When he saw the list he realized that the some kids have been registered twice…

Santa :santa: needs to help from the Robot :robot: to identify the kids registered for both the sessions…Robot :robot: delivered the result quickly

Santa is happy and Satisfied the kids wishes as promised…


XAML : (55.2 KB)



Santa :santa: was selected for the Football :soccer: Club Barcelona in the month of October 2020.

And Today’s Match with Real Madrid has been tied with the Score of 0-0

But the Match Referee has decided for Penalty Shootout

Because In a penalty shoot-out, each team takes turns shooting at goal from the penalty mark, with the goal only defended by the opposing team’s goalkeeper. Each team has five shots which must be taken by different kickers.

But here is the problem with Santa’s players list. because the player’s list is messed up that santa :santa: was supposed to use for the Penalty Shoot-out due to some mistakes made by the new version of the list.

And now Santa :santa: is in big trouble :roll_eyes: :roll_eyes:. because Santa :santa: is not able to decide which player he will send for the Penalty Shoot-out asper their shoot-out skills because there are some duplicate names present in the list.

But suddenly Santa :santa: get an idea :bulb: and he decide to discuss this problem with Magician Messi :star_struck: :star_struck: :star_struck: :heart_eyes: :heart_eyes: because Messi is a Captain of the Barcelona Team.


And Messi has a plan for this problem.

And he will be using his some Dribbling Skills to get a rid from this problem.

Messi decide to first merge both the files A and B after extracting the folder and then he will get the merge players names in the new File.


Then Messi read the Merge file.

After reading the Players Name list from Merged File for penalty shoot-out, he found that there are some duplicate players name.

And suddenly he got an Idea to remove all the duplicate players name with the help of his Magic. because he is the Magician :tophat: of football :soccer:.


here is the complete Magic flow of Messi the GOAT.

Workflow 1

Workflow 2


After Successfully removing the duplicate Names. Messi show the final Player’s Names to the Manager Santa :santa: :santa:

Here is the Player’s Name:


Now, Santa can easily decide which player will go first for the Penalty Shoot-out. :heart_eyes: :heart_eyes: :heart_eyes: :heart_eyes: And he is also very confident that his team will surely win the game against Real Madrid


:heart: :heart: :heart: :heart: :heart: Always

Barca Love
Cg-jD11UYAQjNiW (36.5 KB)


After a Match Santa :santa: told Messi to delete the Mess file also which will be the latest modified file.

Messi accepted the new challenge again because he is a G.O.A.T and he loves challenges. :wink: :wink:

And now he will be using detailed pass map :world_map: to get the latest player’s name file list Date Time.

Let’s see the Messi’s Passmap workflow for deleting the latest file.

Workflow 1

Workflow 2

After using his magical power, he has deleted the latest created file (Highlighted in Red Underline).

LatestModifiedFileDateTime_Output (23.7 KB)


Advent Challenge #5 Beginner

Santa is sitting at home and watch the Muppets sport show. He is angry about Jingle-Bell, his assistant. Such mistakes should not happen, he thinks. There we are doing Scrum and working agile and still it happened, so close to Christmas. Santa admonishes Jingle-Bell, don’t do that again boy.


Santa decides to develop an Invoke Code activity to solve the challenge. So he starts the editor and develop a tiny code sequence.


After the developing and testing he transfers the code sequence to the Invoke Code activity.

The code is very easy to unterstand. Santa creates a data table and stores all Excel files from the current directory in it. He sorts the table according to the creation date. In the last step he deleted all Excel files with the exception of the youngest, which has been created last.


string Dir = Directory.GetCurrentDirectory();

DataTable FileList = new DataTable(); 

try {
  string[] Files = Directory.GetFiles(Dir, "*.xlsx");
  foreach(string File in Files) {
    DateTime FileCreationDate = Directory.GetCreationTime(File);
    FileList.Rows.Add(new object[] { File, FileCreationDate });
  FileList.DefaultView.Sort = "FileDateTime ASC";
  FileList = FileList.DefaultView.ToTable();
  long i = 1;
  foreach(DataRow row in FileList.Rows) {
    if(i > 1) {
      Console.WriteLine("File deleted: " + row["FileName"].ToString());
    i += 1;
} catch(Exception ex) {


All works well and expected. Santa feels good and watches more sports. An interview with Gonzo. Santa wonders himself what he would look like with that nose.



Advent Challenge #5 Advanced

Santa is a poor man, nothing has changed since Challenge #3. No Office and no Excel is available. So Santa has to convert the worksheets into CSV, in his opinion the better format anyway.

Santa wants to laugh, so he watches the comedians Laurel and Hardy, in sports activities. First the men’s ballet. How gracefully he thinks.

Santa codes a tiny Invoke Code activity to transfer the content of the CSV files into a new data table. The code is easy to understand. A loop over all CSV in the directory and the content of each CSV is added to a new data table.



string[] Files = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.csv");
foreach(string file in Files) {
  var lines = File.ReadLines(file);
  foreach (string line in lines) {
    if(line != "Kid;Wish") {
      KidsWishes.Rows.Add(new object[] { 
        line.Split(new string[] { ";" }, StringSplitOptions.None)[0],
        line.Split(new string[] { ";" }, StringSplitOptions.None)[1]

KidsWishes.DefaultView.Sort = "Kid ASC";
KidsWishes = KidsWishes.DefaultView.ToTable(/*distinct*/ true);


Proud is Santa. With two commands of the DataTable class he sorts the table and deletes the double entries.

With the Write CSV activity Santa saves the corrected content.



Last but not least Santa is watching men’s couple dancing. It’s like the dance of the decoration on our Christmas tree.


@StefanSchnell I love your invoke code solutions!

Since the challenge is simple and easy to follow, it gives people like me a basis to follow how code snippets achieve in a small space what we otherwise use UI based workflows for.


Some nice and interesting solutions here… But Grumpy will just do the work here.
Grumpy likes it simple (like version control in UiPath!)

Just let Jingle-Bell give grumpy the two packed lists, and Grumpy will make a brand new list for Santa to use!

There! All done!
And the next time you do this, just use this workflow yourself! Easy!
Grumpy.xaml (39.3 KB) project.json (1.5 KB)


Thank you very much @anupamck :grinning:


:snowflake: Beginner & :fire: Advanced

Once upon a time, in a faraway land a lovely family lived in a swamp.
One day something unexpected happened…

It was a shock especially for Sherek

Fortunately, was cat in boots :cat2:

Cat created the solution for beginner level :


And then …

And Cat in boots also created the solution for advanced level :

result advanced

And everyone lived happily ever after :blush: :santa: :christmas_tree:



Im not sure if other people wondered. Where is Santa!!! Sure did not read in the challenge where he is…

Must be still “Shopping for Gifts”

He must be going in circles due to the duplicate names in his list… that is why he decided not to land anywhere.


But, as per Advent 4 Challenge, We all know where Santa went. Wink Wink

Here it goes!

Due to Santa Saving up for the Holidays… Santa did not buy a license for a trusty version control system. Because of that… He is currently lost in the air until he finds a solution…

So Santa, called his old friend to fix the problem…

Finally, the Rock has come back to help Santa Claus

Solution for ADVANCE

After a very long speech of the rock making fun of Santa using an excel file to store the names and gifts for the elves. He HURRIEDLY helped Santa to merge the files and find the duplicates

Get it? Hurriedly = Faster hahahaha ;p ;p ;p

So the rock created a data table first, then read both Wishes A and Wishes B.
The rock then merged the output of both Data table A and Data Table B into One.


Upon Merging, he suddenly removed the duplicates then sorted the data table

image image



This gave a quick Victory for the Rock!

Suddenly, Santa called again, but the rock is too tired. So the rock asked his friend to help Santa with his next task

Beginner Solution

The rock then call Maria! He Said, Maria, if you help Santa. I will give you front row tickets to my next movie :smiley: :smiley: :smiley:

Maria was so delighted she had to close her fist and smile and open her mouth to show her enthusiasm

She then said “Just Bring it!”

image image

So the rock told Maria Sharapova of Santa’s issue and would like to delete the latest file based on creation date.

Maria Sharapova had to think for 1 minute and 03 Seconds

but nothing came out… so she asked for 2 Minutes more :smiley: :smiley: hahahaha

Then she realized the solution. So she said! Game on Santa!!

She through the solution right of the Bat!!! I mean Tennis Racket

It was a very hard swing!

So, she said Santa, i will compare both files using files.getcreationtime to solve your problem.

And I’m Going to use Multiple Assign!!! (She said very proudly as if Santa will be impressed)

After that i will be able to get the date and other timestamp parametes in the file… trust me i will


Then she ran the code… Then the output came out :smiley: :smiley:


The she told Santa… you trust me now?


And that is the story of how the Rock and Maria was able to help Santa.

by the way…

We managed to find where Santa went.

we saw him somewhere in the UiPath Reboot Work Festival… Must be inside the big tent

Or maybe inside the Souvenir Shop

Looking forward to the next Advent Challenge!



Ho ho hoo…Mary Christmas

:evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree: :evergreen_tree:

If you wish to watch my Santa Story the

Episode #1 ==> :snowman_with_snow: Advent Challenge #1

Episode #2 ==>:Santa: Advent Challenge #2 (Everyone welcome to join the event!) - #36 by Maneesha_de_silva

Episode #3 ==> Advent Challenge #3 - #39 by Maneesha_de_silva

Episode #4 ==> Advent Challenge #4 - #39 by Maneesha_de_silva

:star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck: :star_struck:

Welcome to my Santa Story Episode #5 (Beginner & Advanced Challenge Inside)

:point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right: :point_right:

Santa Suddenly heard that lady was crying… Santa was wondering who is she … sounds like very familiar who may be … :thinking: :thinking: Is that @Luiza :thinking: :thinking: :thinking: :thinking: :wink:

Santa ran to the next room and opened the door

OMG… Its Jingle-Bell…

Santa: oh my lady what happened? why are you crying? , have you seen any ghost ( My Episode #4 )
Jingle-Bell: No… eh eh eh…
Santa: So why are you crying then?
Jingle-Bell: I made a terrible mistake eh eh eh…

                    Again She was crying loud......

Santa: Its ok dear tell me what happened, we need to hurry we are almost late now
Jingle-Bell: your wishes excel … eh eh eh…eh eh eh…
Santa:: Ok ok then… what happens…
Jingle-Bell: wishes excel has been edited by mistake and now there are duplicate and also i cannot find what i have last created eh eh eh…
istockphoto-153388297-612x612 Jingle-Bell is really upset about it …

Suddenly Santa start laughing

Jingle-Bell was angry about that
why are u laughing now, you know want you have lost all wishes and now you are laughing

Santa: You know what, don’t worry my dear… Last year I have modified my Sleigh
with few technologies, I can do my most of the thing on my Sleigh Dashboard don’t worry lets go into my Sleigh

Now You Wondering About The Sleigh DASHBOARD Isn’t it
here we go …

Then Santa access his Sleigh Dashboard and made a new file by removing duplicate
File Name: Kids Wishes Secure.xlsx
Advanced Challenge :
Duplicate Remove Configuration Module : Main.xaml (6.4 KB)

Beginners Challenge :
Main.xaml (9.6 KB)

UiPath APP File: GitHub - manee4422/UipathAPP-Challange5

The below Video show you that How Santa’s Sleigh Dashboard will work

Function: Data Rettriving by Unattended Robot and Sending the Information to UiPath APP and Display via UiPath App With some artificials/By the button of commanding Unattended robot running the process to delete the file :stuck_out_tongue_winking_eye:


Dear Santa,
So glad to hear that assistant Jingle-Bell got a personal digital coworker that can do the boring job to assembly all the scattered wish lists into one with unique wishes.
Now Jingle-Bell can play paddle with his kids instead.
#Challenge5 #Advanced
Main.xaml (13.0 KB)



Santa needs the mess that Jingle-Bell accidentally made. UiPath bots as always are here to help
Excel Manipulation are so easy with UiPath and here is the workflow

And here is the execution outcome
Santa is happy that the mess was cleared in no time.
AdvancedChallenge_5.xaml (9.0 KB)


We figure out why Jingle-Bell not using source control: he was in love

I am more than happy to help him with 2 different approaches to his problem.
I have posted here a YouTube video about this:

1 Like