10
 Followers
65
 Likes

Improve automatic data type setting behavior when renaming a variable

Service Studio
Implemented
on 21 Jul 2020
Development Environment Release 73

When you name a variable the Outsystems platform automatically sets a data type based on that name. When you create a new variable, this behavior is mostly correct and helpful. Sometimes however, the platform is just plain wrong in guessing the data type. No sweat, you change the data type manually and the problem is solved, so you would think...

However, when you now copy that variable and change the name of that copy, the platform again tries to guess the data type and, yes, again it guesses wrong. Even when you rename the original variable the same thing happens: wrong data type again. The result of this behavior is that you have to manually change the data type again, and again, and ... yes, every time you rename a variable! This becomes a frustrating exercise very fast!

To prevent this issue I would like to propose that setting the data type of a variable automatically is NOT performed when either,

- the data type was set manually by the developer

- the variable was copied


Please vote for implementing this if you agree.

Created on 29 Jan 2018
Comments (35)

Hi Frans,

Thanks a lot for your feedback, actually you are not the first commenting this.

We'll take a look at it, and I'll probably invite you to give us feedback on the proposed solution ;)

Cheers!

+1

Merged this idea with 'Disable Data Type change' (created on 26 Sep 2019 15:28:59 by Hugo Duarte)

How many times did you wanted to change the name of something, WITHOUT changing the data type?

Please make this happen, or have a setting to disable the Data Type prediction auto-change.



This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:32 by Vasco Pessanha

Do you mean no DataType hinting on LowCode platform?



This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:32 by Vasco Pessanha

No i don't mean hinting, because it will automatically change the data type while chaning the variable name.



This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:32 by Vasco Pessanha

Hi Hugo,

I agree with you, this is mighty annoying, especially because the auto-guessing could be a lot smarter (e.g. first search for Entity names, and only if not found check for things like "Number"). Note however, that the guessing stops as soon as you use the variable (or parameter, attribute etc.) somewhere.



This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:32 by Vasco Pessanha

Hi Kilianm,

While creating records or some variables with not typical/simple data types (like List Records with X number of data types) while changing the name, if at some point the name or part of the name will Auto-guess something, will undo the work defining the variable and set it to some random entity.

The feature is very good, could be better but still very good. I just want the ability to temporarily/permanently disable it. 



This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:32 by Vasco Pessanha

Yes indeed, the basic functionality is a-ok, but there can be some improvements making it better.



This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:33 by Vasco Pessanha

Changed the category to Service Studio




This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:33 by Vasco Pessanha

Nice!



This comment was:
- originally posted on idea 'Disable Data Type change' (created on 26 Sep 2019 by Hugo Duarte)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 25 Nov 2019 09:12:33 by Vasco Pessanha

Hi, 

Just adding to this idea. Perhaps you guys can consider doing how microsoft office does this and add this auto change as an undoable action that we can quickly ctrl + z. 

Merged this idea with 'On variables with more than one data type don't allow naming change it's type' (created on 02 Feb 2020 17:50:01 by Ruben Silva)

I don't know if i made it clear on the title or i was doing something wrong, but i had this one situation where i had a variable with many data types and it frustated me that every time i changed the name of the variable it kept changing to other data types, making me to set all the data types again.



This comment was:
- originally posted on idea 'On variables with more than one data type don't allow naming change it's type' (created on 02 Feb 2020 by Ruben Silva)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 04 Feb 2020 15:13:48 by Kilian Hekhuis

It does that until you use it in your code, then it stops. That is known, expected behavior. It's often not what you want, though. :(

J.Ja



This comment was:
- originally posted on idea 'On variables with more than one data type don't allow naming change it's type' (created on 02 Feb 2020 by Ruben Silva)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 04 Feb 2020 15:13:48 by Kilian Hekhuis
Merged this idea with 'Undo an automatic changing of data type' (created on 06 Aug 2017 12:26:04 by Wouter Teensma)

ServiceStudio is usually very helpful in 'guessing' the intended data type of a new variable or attribute. 

However, sometimes, when I change the name of a variable or attribute afterwards, Service Studio again 'helps' me by changing the data type, which I don't always want. 

It would be helpful to have a little undo button somewhere in the data type property field, so I can undo the automatically data type change, in cases where I know the original data type is what I wanted instead of the new data type that ServiceStudio thinks it should be.



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Either that or a checkbox or something to "lock" the type of a variable and prevent it from being automatically changed.



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Note: Once the variable/attribute is in use, the auto-typing stops happening. Problem is, it will be more clicks/interaction to lock it, than to set the type again. :(

J.Ja



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Well Justin, in most cases you are correct, but I've had this issue with a variable which was a list of type record with 6 different structures and it just changed this to a simple record of one structure after fixing a typo in the name.

I don't that that a checkbox is the right solution, because you have to know beforehand that the type is going to change or you have to do the change, see that the type changed, undo the change (CTRL+Z), set the checkbox and redo the change, which is indeed a lot of extra work to prevent the change from happening.

I would like to see a similar functionality as in Word when you paste a piece of text. A small popup that auto-hides after a couple of seconds and in which you can decide if you want to change the type of keep the type and only want to change the name.

Remco Dekkinga



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Like the idea! This data type guessing behavior when we rename variable/attribute is really annoying! Because of this I sometimes include in the description of the variable/attribute the data type, to be able to detect when the data type has automatically changed and I (or other developer) did not notice.

I am not sure about what the best implementation would be (undo feature, lock mechanism, other?).


Justin James,

what do you mean by "auto-typing" in:

"Note: Once the variable/attribute is in use, the auto-typing stops happening." ?

Is it "automatically data type changing"?

But I think in Service Studio even if that variable/attribute is in use sometimes the data type gets changed if you rename that variable/attribute.




This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Tiago -

Yes, that's exactly what I mean.

In almost 9 years of using Service Studio, I have NEVER seen a data type automatically change *after the variable is being used*.

J.Ja



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Justin,

You are totally correct about "I have NEVER seen a data type automatically change *after the variable is being used*.". Myself did not realize that.

BUT, since Service Studio only validates the usage of the variable/attribute within the same eSpace, this situation still occurs, for instance, when renaming attributes in public structures that are not used in the eSpace where they are defined and are only used in the consumer eSpaces.

Tiago Bernardo



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Tiago -

Got it! Yes, that makes sense. That sounds like a "bug" to me, I suggest you file it.

J.Ja



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

This is a love hate relationship.  The following use fits my needs:

The smart Data Type auto feature should be initially turned on for a given parameter after the parameter is created.  The auto smart Data Type auto feature will turn off when either of the following conditions occur:

  •   The Data Type is manually changed from within the Parameter property window.

or

  • Upon the exiting of the Parameter property window session (to some other object) where the Name property was manually edited in the Parameter property window session.




This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

Erik -

#1 is *already* the case.

J.Ja



This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis
Merged this idea with 'Add a shortcut to disable DataType change while renaming variable' (created on 03 Jan 2019 14:12:23 by Mykola (Nick) Tkachenko)

This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

It is frustrating sometimes when I'm renaming a variable and the data type changes automatically if there is a math with entity name. It should be possible to rename without changing data type for example holding Alt key... or have a setting to disable type change while renaming.



This comment was:
- originally posted on idea 'Add a shortcut to disable DataType change while renaming variable' (created on 03 Jan 2019 by Mykola (Nick) Tkachenko)
- merged to idea 'Undo an automatic changing of data type' on 04 Jan 2019 11:08:53 by Vasco Pessanha


This comment was:
- originally posted on idea 'Undo an automatic changing of data type' (created on 06 Aug 2017 by Wouter Teensma)
- merged to idea 'Improve automatic data type setting behavior when renaming a variable' on 20 Feb 2020 15:41:27 by Kilian Hekhuis

I just merged the Idea "Undo an automatic changing of data type" into this one. Normally I merge the younger one into the older one, but in this case, the "Undo" Idea is more of a subset of the overall idea of improving the way the auto-type-guessing works, so that's why I merged it backwards (sorry Wouter :)). The upside: this Idea has now 59 votes! Yeah! :)

Came back to this idea after having again frustrations with this same issue... :/

Maybe instead of overthinking for a perfect solution, why not just provide a configuration in "Preferences" where the developer can simple just enable or disable it?

There are quite a few options already there, including the most recent for AI-Assisted Development that can be disabled. How difficult can it be to also allow disabling the "automatic data-type setting"?...

Something as simple as this would already make us so happy! :)

--Tiago Bernardo

The option of CTRL+Z to undo the automatic data-type setting, mentioned here in this topic, is also interesting but I believe not so simple to implement.

--Tiago Bernardo

The main problem with Ctrl-Z is that there must be something in the edit history to undo. But currently I don't think the type-guessing is in the edit history, mainly because there's no user command to type-guess something (would be swell as well, btw, to be able to re-guess the type, and cycle through various possibilities).

Complementing my comment of "provide a configuration in "Preferences"", even better would be a shortcut key that we could quickly use to enable/disable the functionality as needed. Sometimes it is useful to have it on, sometimes it is useful to have it off.

--Tiago Bernardo

Changed the status to
Implemented
on 21 Jul 2020


Hey Frans (and all the other 65 likes),

I'm glad to announce that we've just improved the way the product automatically sets the type of the variable based on its name.

From now on, we have:

  • An improved algorithm that is smarter auto guessing variable types based on dozen of examples provided by the community
  • We only automatically guess the type in the first time, if the variable has the default type ('Text'). If you already spend some time changing the type of the variable we won't reset it when you change its name

As always, you can find your contribution in our product release notes:
https://www.outsystems.com/downloads/ScreenDetails.aspx?ReleaseId=19480&ComponentName=Development+Environment&MajorVersion=11 


Thanks for the feedback,

Hope you enjoy it!

views
2033
Followers
10