4
 Followers
22
 Likes

Better default label for assignments

Service Studio
New

Not too long ago, we got For Each nodes to display the name of the Record List as its default label. Could we get something similar for Assign nodes with multiple assignments?


Current behavior

When creating an Assign node with only one assignment, its default label becomes the name of the assignment.

After adding 2 or more assignments, the default label changes to a generic "Assign" name.


Proposed behavior

The default name of the Assign node would be the conjunction of all common leftmost names of its assignments.

If a common name cannot be resolved, then it defaults to the generic "Assign" name.

Examples below:


Example #1 - Common name "MyStrucutre.InnerStructure"


Example #2 - Common name "MyStructure"


Example #3 - No common names, defaults to generic "Assign" name


Remarks

  1. The "Assign" generic name does not add any value to the understandability of the code. Thus, any feature that attempts to display a meaningful label instead of this generic name is a valid product enhancement effort IMO.
  2. Good practices say that you should always custom-set the labels of your Assign nodes. However, as we know it, many assignments created every day by the average user are unlabeled.
  3. With the proposed behavior, developers are more likely to split big Assign nodes -- that contain assignments of different/unrelated records -- onto smaller Assign nodes (each containing values of one individual record) due to the automatic naming convention, improving code readability.
Created on 5 May (4 weeks ago)
Comments (9)

Excellent idea! Even nicely written!


Well explained and good for the redability.

Great!

Good one Caio! 

Nice idea. 

Great idea

Good idea!

Totally agree that setting the Label of Assigns is a best practice to follow for flow readability.

In this specific case of an Assign setting several attributes of the same record (entity or structure) I always manually have to set the Label to the name of the variable. Not very efficient, so if Service Studio could help it would be good.

Regarding the topic of Labels of Assignments, also consider looking at these two my ideas:

  1. https://www.outsystems.com/ideas/9044/assign-with-only-one-assign-should-have-the-label-set-to-variable-value
  2. https://www.outsystems.com/ideas/9043/empty-assign-should-have-the-label-empty-instead-of-assign-to-distinguish-fro

--Tiago Bernardo

Awesome idea to improve code readability.

I can't count the amount of times I have spent renaming assign nodes.

views
136
Followers
4