Hello, I would like to create a process in UiPath Studio that allows me to enter my travel destinations into an Excel spreadsheet. I have successfully completed the process up to this point. I use “Input Dialog” to ask myself three questions. 1. Where were you? 2. What did you do there? and 3. How long were you there?
I have managed to get the Excel spreadsheet read, check whether there is already something in the columns, and then insert another row with the information from the three questions.
So far, so good. Now for my question.
The information is currently all inserted into Table1. This means that all the travel destinations from the first query are mixed together there. I now want the bot to recognize which destination was selected and then copy the row to the other spreadsheets as well.
! Important: everything should take place within the same Excel file and only be copied/distributed to different spreadsheets. !
E.g.
Where were you? Paris
What did you do there? Sightseeing
How long were you there? 5 days
The bot should then copy this row to the “Paris” spreadsheet so that Table 1 contains all entries ever made and the Paris spreadsheet contains all entries collected in response to the first question with Paris.
Since I am completely new to this topic, I would appreciate a very detailed description of a solution, preferably a click-by-click guide or a ready-made process in Studio so that I can follow it step by step.
You can write all entries to the main sheet using Write Range or Append Range. After that, read the value from “Where were you?” and use an If activity to check whether a sheet with that name exists using Workbook Get Workbook Sheets. If the sheet exists, write or append the same row to that sheet. If it does not exist, use Add Sheet and then write the row.
The row data can be stored in a DataTable with Build Data Table and then appended to the correct sheet. This allows Table1 to keep all entries and each destination sheet to receive only the matching rows.
If helpful, mark as solution. Happy automation with UiPath
I recommend some things,
Please don’t use nested do while loops , use only one do while if needed you can go with add data row after this use write to excel once.
Hope this works!
then only thing you need to do is first get all the unique places from your main sheet. dt.AsEnumerable.Select(function(x) x("Place").ToString).Distinct - here dt is the datatble with main sheet data..then this gives a list of unique places
Now loop on this unique list and inside it use filter datatable on dt to filter with currentitem and get all the rows belonging to that place..which you then need to write it to respective sheet
Thanks for all the tips. Unfortunately, I’m still stuck. I’m already completing the workshops in the Academy. This is a project for me to see what I can already do. Is there any chance someone could build the process in Studio and show me? Then I can recreate it and maybe understand it better.