When you automate a drop down with the Activities - Select Item activity, studio automatically generates a drop down with all the available options for you. Great! But…
We create library workflows that are re-usable, so when we automate a dropdown we want the user to provide input on which item to select from the dropdown: we need an input argument:
But now that we made a string input argument, we lost all of those options from the dropdown. So we need to provide those options again, validate that the user didn’t make any typo’s, etc etc. Activity layouts help, but manually providing all those values for every single dropdown gets boring quick.
I would love it if we can somehow get these values as options in the argument quickly. For example: Studio automatically generates an enum object with all options. Or a button that copies all values so we can create a solution ourselves with custom code, the activity layout, etc…
For that you would use Find Children to get all the options and then compare the user’s input. This way you are doing it at runtime so that if the options change you don’t have to touch your code.
As I understand it your main concern is how to get easilly all dropdown options to fill it in custom activity layout, right?
If this is the case I suppose you could create a utility workflow, use “Get Attribute” activity to retrieve all the options and save them e.g. to a file. Then simply copy/paste options to activity layout.
Yeah, I suppose I could do it like that as well. Most of the times i just copy directly from the HTML. But I’m hoping for an easier & faster way directly in the activity.
That way indeed seems usefull for when the options could change during runtime.
In my scenario the option’s stay the same, so we want to provide those options to the developer that uses the component in the robot. If you look at the last screenshot, that’s what I usually do: I use the activity layout to generate a dropdown for the developer because it’s nicer to use. I’m just looking for an easier way of making that.
I’m confused why you would need to do that for the developer when the Select Item activity already does that for the developer. Why are you using a custom activity instead of just using Select Item?
Yeah, even if we could do that the effort wouldn’t be worth it, this is just a quality of life thing. I’m posting this more in the hopes that UiPath would see it so they can maybe improve the current activity
If you are content with them being effectively hard coded, then an Enum provides this.
You can make the Enum in your library and set the argument to an Enum, The activity layout with then use the Enum to make the options in the dropdown so you can just select them in the way you show.
Because if i automate a webpage, i want to make it re-usable for the team and only have to change code on one place if changes happen. Basically this Studio - Methodology for reusing UI components, but we currently don’t use the object repository.
@postwick, do you code directly in the process? So i mean in the re-framework or it’s equivalent? We do all application interaction in libraries
Hi Jon, yeah enum’s are perfect for this scenario. I know, and have made, those drop-downs with my own enums.
Now that I need to automate them on a regular basis, this application is riddled with drop-downs, I notice it’s becoming a drag to keep copy pasting the values just to make it nicer to use. That’s why I was hoping the activity could be improved somehow.
Except even custom libraries don’t work that way. You’d still have to open each automation that uses the library, update it to the new version of the library, and republish. What kind of changes are you encountering that require this to be done?
Yup, that is still the case. UiPath does have a ‘project dependencies mass update’ tool in studio that helps with this, but I haven’t used it yet because yeah, there isn’t often a change in an application that completly breaks every bot which requires you to immediatly update all bots.
But I find it usefull that the code for interacting with an application is in one place. Yeah you can probably copy-paste the same login to 8 different bots, but if you want to make a change you then also need to remember to do it every single time you make a change to the bot. It’s easier if you see a new package being available, you click update, done.
It also helps with new bots, since your library is basically a big overview of all of the functionality you, and your team, already made for that application. Just drag & drop at that point
That tool doesn’t update the published projects. It just updates the project.json file in each project. You still have to open and republish each project.
I understand the point to using libraries to limit code editing when things change, but I’m asking what specifically is changing that is affecting your code with respect to select elements.
You sure? If i look at the documentation it seems to update, publish & commit each project now - if you want to. But that’s beside the point, in practice you barely need to update several bots at the same time anyway, I haven’t had to use it.
At my current client we don’t experience changes in applications often, so for that it isnt really needed. Most of our bots aren’t even up-to-date with the latest versions of libraries and that’s OK.
I would say the main advantage of libraries here is more to have one shared place of tried & tested functionality for each application we automated as a team. Easier to manage one codebase than multiple.
So I’m creating a component that others can use to, among other things, select an item from a drop-down. By providing which values can be chosen from it’s easier to use. Nothing is changing - I just want to provide more info to the developer when he/she is using that component in the process. Just like an annotation.
If you look at the component above, you would instantly know what is valid input for “opt_status” , but for another input argument, like “opt_belastingjaar” you would have to take a look at the actual application or given input data. No good or bad here, just detail and ease of use.