@private_matter Services in the Repeat Number of Times Activity can’t read any value that is why it is not entering in the switch case. It just gives the current looping number. But, there is one way of using switch with this activity with the below condition. Go through attached workflow
I’m not looking for something complicated. I would like to use the RNOT activity as I can start the sequence at a particular case. Not sure if this can be done with For Each.
i don’t see what this has to do with what i was asking. how can you repeat each case multiple times in the for each activity? the for each only iterates a single time for every switch case. what if i want each case to be repeated 5 times? that’s why for each does not suit my requirements.
Edit: Can the RNOT hold a string variable or is it only allowed to have an Int32 variable such as CurrentItem? Found no meaningful documentation on UiPath site.
Thx but that’s not so convenient to do. If I can put string names in RNOT it would have been much easier.
Imagine I’m placing For each item {“Copyrighting”, “Copyrighting”, “Copyrighting”, "Graphic Design, “Graphic Design”, “Graphic Design”, “Social Media Marketing”, “Social Media Marketing”, “Social Media Marketing”, etc…}
That is literally super-inconvenient, time-consuming, and highly inefficient.
Would they all repeat the same 3 times? Then just put the For Each inside a Repeat. Then it’ll For Each through all of them 3 times.
If you need it to do, say Copyrighting three times and then Graphic Design twice, and then Social Media Marketing once then create yourself a Dictionary. The Dictionary would be…
myDict(“Copyrighting”) = 3
myDict(“Graphic Design”) = 2
myDict(“Social Media Marketing”) = 1
With myDict defined as Dictionary(of string, int32) it would look like this…
So the dictionary keys are the names of the Services and the dictionary values are the number of times to repeat.
If you need ease of changing the list of Services and how many times each is repeated, then you could store that in an Excel file with columns Service and Repeat, read the sheet with Read Range and put it into a datatable. Then your For Each loops through the datatable.
Note that the Index part of the repeat simply stores that you’re on repeat 1, repeat 2, repeat 3, etc. You don’t need it for anything you’re doing here, but there must be something there so I put index to make it clearer what it does.
That is still toooo much input. I’m not gonna create dictionaries and so on to do simple tasks. I should be able to iterate through cases without all this complexity. No I’m not gonna use your method. I deleted the For Each and used RNOT instead. I will use Int32 cases 1 to 12 and with each one inside, I will exchange the Sequence names with the names of the services instead. I don’t understand why RNOT cannot hold any string variables. That just sucks a lot from UiPath. I always try to seek the shortest and easiest way, but there doesn’t seem to be any except my way currently.
At least I can still see the sequence names as in the screenshot below.
Then being a programmer is the wrong job for you. This is how you do things as a programmer. You seem to be expecting one of these and you just press it and your code is written.
For Each is not complex. Nor is the bit of code I posted for you. If you think that’s complex then you’ve never been a programmer before.
You’ve just added complexity because now you have to remember which number corresponds to which Service.
Because that’s what For Each is for.
You have experienced people here telling you the right way to do things and you’re being stubborn and petulant. I’ll avoid spending MY time helping you in the future.
Doing complicated stuff doesn’t make you smarter in an inch. I’m not here to waste my time doing a simple thing that shouldn’t take so much time. I do understand what you’re suggesting here, but I still don’t find it practical because it requires too much input. If I can create Int32 that easily, I should also be able to create String values that easily as well. The thing is that UiPath simply does not have this feature implemented yet just like they have many unfinished bugs still left in the program.
I took a complicated task you couldn’t figure it out, figured it out for you, and posted extremely simple code to achieve it. You don’t know what you’re doing.
You have no idea what you’re talking about. Setting up a simple dictionary is not “too much input.”
You can. We showed you how. You rejected a ONE LINE piece of code as too complicated.
You don’t even realize this is all vb.net - it’s not things UiPath wrote. This is standard programming stuff. You have a lot to learn. UiPath just made a way to abstract it all behind visually presented activities, and they did a phenomenal job of it.
What might sound simple to do for you might not be simple for others. For me, I still consider that too much unnecessary input. The question is not about if I can do what you’re suggesting or not, the question is that it’s simply not practical to create dictionary keys and set values for each one in order to loop a certain activity multiple times. You could for instance have an option on the right panel that you can easily set how many times you want it to iterate or better off, even have a dropdown menu for you to pick the number of times. That will drastically reduce my time spent achieving my goals instead of manually typing all the values myself. I don’t know if you’ve ever heard of the word efficiency, but that’s what I usually look for. I don’t need to spend 10 hours trying to learn how to loop an activity when I should be able to do that in less than a minute.
Go checkout modern website editors like Webflow. Perhaps then you’ll understand what I mean. You don’t need to input pure raw text in order to build a professional website. You can easily achieve what a webmaster dev does with minimal to none coding knowledge.
Bottom line, even if I learn and master RPA, I’ll still tells you that this method sucks! Simply because it can and should be done in a much easier and efficient way.
But that’s not all you’re trying to do. That is not an accurate description of your requirements. Your requirements are more complicated than that, hence the code is slightly more complicated.
You never even answered my question about the repeats. If you just need it to repeat each Service 3 times, you don’t need the dictionary. I explained this. I then also gave you an example that would allow you to repeat certain Services a different number of times.
So go build web sites. This is process automation. If you think setting up a dictionary is too complicated then you’re in the wrong job. That’s all there is to it. You have no clue how complex automations can be.
So go write your own RPA design solution and compete with UiPath. On the way to doing that, you’ll realize this has NOTHING TO DO WITH UiPath. It’s programming in vb.net. That’s why there are things like For Each and Switch.
Haven’t you ever learned any other programming language? These operations have been around for decades.
My requirements are not complicated at all. The program simply lacks the features necessary to make the user’s building of a script easier and faster. If I were to build the program, I would try to reduce the maximum data entry possible for the user in order to reduce the user’s time spent on building the script.
Which one would be easier in your opinion, for instance, to navigate every time to C:\Users\Username\AppData\Local\Google\Chrome\User Data\Profile 23 or to simply create a shortcut for the path on your desktop with one click that opens your desired path?
Both can achieve the same result, but one is absolutely much faster than the other. Take sorting in UiPath with the Switch activity. If I have an array of strings with lots of 100s of names, I must go and click on Variables, then open the default expression, and then cut/paste every word string that I want to change its position to another place so that the bot can execute in chronological order. I could have achieved the same thing if there were drag n drop sorting buttons in the switch which should have taken me a blink of a second to do without all these extra steps.
UiPath might be a great software but it sure as hell has its own flaws and is not pitch-perfect. Their documentation is also bland as well and does not explain everything. The repeat number of times activity documentation is obviously a big joke.
Where in the hell does it state if I can use string variables instead of Int32’s default CurrentItem? That’s right. Nowhere! So basically I should either do some trial and error in the program in order to see if string variables are accepted or not, google the issue, or post my damn question in the forum hoping for an answer because their documentation is utterly super poor.
It took me less than a minute to make it for you. That’s not hard and slow. And it’s exactly how you’d do it in any programming language. That’s what you don’t grasp. This kind of programming logic has existed for DECADES. It’s basic stuff. I’m done here.
You can’t because that field in RNOT stores the index number of the loop. Just like the index property of For Each.
You never learned any other programming language, have you? Never seen…