May I ask for some more details about this? An use case maybe? Currently you can leave the Else box empty and it will work like you proposed.
Thanks,
Viorela
Itās more related to code clean and organized. It leaves the āelseā in blank waste the limited space that I can see on the screen. Itās all about User Experience and clean code.
Itās the same case for Keep Acitvity Panel Size
I was just now looking for such activity
When we need to execute a block if a condition matches else need to skip it, as of now, we still use the one activity that is there in UI Path. This serves the purpose. But this activity will check the else part as well even though itās not necessary for the flow. This includes an execution time.
It will be good if a if-only activity is added into the activity list.
Hi @Madhavi
I am not sure I understand. If you are 100% certain that your condition will always return True, then you donāt need an IF condition at all.
Also, I think Else is only executed when the condition evaluates as False. At the very last, it serves as the perfect place to throw an exception if you need to be 100% sure that Then is always executed.
I seeā¦ I still donāt get the point Wouldnāt you always want to log the exception when something is not as you expect it?
Either way, Iāll merge your topic with the older one to keep the discussion together
Actually, itās one null check difference ā see source here (lines 85-98). If
activity hasnāt been changed in ages, so even though itās newer source itās still the same.
There is also a refactoring consideration - if at some point in the future you will need the Else
branch, you canāt just fill it in, you have to recreate this part using the original If implementation.
Itās UiPathās call, but Iād say this one is probably not worth it.
More to the actual point though, ārelated to code clean and organizedā
i agree some big efficiency gains if we can standardize the size of the activity block in workflow/diagram ui.
the varying sizes of the activity blocks in the workflow is very messy and the inability to resize is limiting / causes restraints on comparing code / reviewing / just plain looking at it.
I suggest cosmetic revision.
Please, make visualisation of block āElseā in the Activity āIfā optional.
Yes! Thatās something me and our team thought of some time ago and would definitely be an improvement.
I am not sure about the complexity of this, but UiPath could at least create an āIf - Trueā activity with only the āTrueā block. There are plenty of cenarios where it would be useful.
They already have redundant activities like āDouble Click ā¦ā that itās the āClick ā¦ā activity with the value āCLICK_DOUBLEā on āClickTypeā property.
Yes, definetely You are right - addition of just āIf trueā activity would be best solution for compatibility!
Hi @user42
Welcome to our UiPath Forum!
I merged your topic with the similar one to keep the discussion in one place.
Please see the comments in this topic for further insight. You can also vote up the feature
When using If Activities, it is not always the case that both sides, If and Else, are going to be filled out. The extra space thatās taken up by either unused area generally looks bad, especially with increasingly nested blocks.
I propose that the Else case should not be visible by default and that it can be added if it is needed as this would be a cleaner approach. The If case should likely be always visible because the expression can be flipped using Not in order to change the logic such that it is used instead of the Else case.
Hi @dmccammond,
For this you can just use Flow decision
activity which is working as same as If
and looks better and take less space
A Flow Decision is used with Flowcharts. What I am talking about is the If Activity that is used in Sequences.
Have you tried Switch
activity then? Itās almost the same and you have by default just one case for the expression.
While the Switch activity would allow for the usage of the entire width of the activity, I would argue against using it as that would make it harder for other developers to interpret and understand the code as they may understandably believe that there is something in the default case selector or that multiple options were intended but not utilized. This is not the same case with If statements in programming where conditional programming without an Else case is widely used and understood.