Hey everyone,
I’ve been trying to teach myself custom activity development in UiPath — mainly how to build the UI and wire up the internal logic, and eventually get to a point where I can recreate functionality like Excel Application Scope or If, where you can drag and drop other activities inside them.
I’ve watched a bunch of YouTube tutorials and gone through the official docs, but honestly I’m more confused now than when I started, because the two seem to teach completely different approaches and neither really explains the “why” behind it.
A couple of things I’m stuck on:
->1. Attributes vs ViewModel — am I missing something?
The tutorials I followed use simple attributes on the properties, like:
[Category("Input")]
[DisplayName("Timeout (ms)")]
[Description("Specifies the amount of time (in milliseconds) to wait before throwing a timeout exception. Default is 30,000 ms.")]
[DefaultValue(30000)]
And I’ve actually built a few activities this way that work fine. But then I looked at the official docs and they’re doing something totally different, using a ViewModel setup like:
// Principal (main) properties
To.DisplayName = Resources.EmailSender_To_DisplayName;
To.Tooltip = Resources.EmailSender_To_Tooltip;
To.IsRequired = true;
To.IsPrincipal = true;
To.OrderIndex = order++;
Since I can get things working with just attributes, why would I need the ViewModel approach at all? Is there a point where attributes stop being enough, or is this more of a “best practice vs quick and dirty” thing?
–>2. The actual thing I really need help with — drag and drop containers
This is my main blocker. I want to build something like Excel Application Scope, where you can drop other activities inside it and they run within that scope. I have no idea where to even start with this — what base class do I need, how do I expose a spot for child activities, and how does the designer know to show that dashed “drop activities here” box?
also the view is very much fine for simple activites which have 8-9 or may be more input/output arguments, when when i try to hide or show something using check box , the view flattens and all the I/O arguments are visible only on Properties Panel not on Canvas.
If anyone’s built something like this before, or knows a tutorial/example that actually goes into this (not just the basic “hello world” custom activity stuff), I’d really appreciate it. Most resources I’ve found stop right at the point where things get interesting.
Thanks in advance!