Option to choose variable/argument datatype when using Ctrl+K or Ctrl+M

Hi,

Scope : Assign Activity

Ctrl+K or Ctrl+M are nifty shortcuts when we have to create a new variable or a new argument in a studio project. But they always default to a string datatype in the variable or argument section/panel. The developer then has to remember or check the error signs in the activity, navigate to variables or arguments panel and set the correct datatype.

A feature which allowed the user to choose the datatype when using Ctrl+K or Ctrl+M would refine / promote the use of these shortcuts.

If this feature is already available, I would definitely want to learn how to use it.

@jeevith

  1. There are many activities in Uipath which creates the output variable to respective/required datatypes.
    for example : Deserialize JSON Activity, Matches Activity etc
    When you create a variable in “Expression Editor”, its automatically creates a variable of that type.
    Refer the screenshts,

image

image

  1. When you create a variable/Argument only in “Assign Activity” → Its default to String.

Hi @Karuna,

That is true, but not when you use Assign activity. I will rephrase this in my request post now.

@jeevith
“Assign Activity” is used to assign different types(data types) of expression so how would it know, which data type it is? That’s why UiPath made it defaults to String.

@Karuna

When you want to create a variable lets say a int variable using assign activity.

You can use Ctrl+K to create the variable (you already know that the variable you want is int type) but UiPath defaults it to string. But thats not what you wanted in the first place.

UiPath can easily implement a keyboard event listener when user uses Ctrl+K in given input locations/activities and allow the user to choose the datatype (in this case int) right there in the studio GUI instead of forcing to navigate to the variables panel and doing the same from there.
This same solution can be implemented to arguments Ctrl+M.

Hi @jeevith

Days ago I proposed a similar idea where the variable/argument type can be determined by inference:

Hi @alexandretperez,

A complete twin request! Good details in your post. Exactly what I was requesting as well. That has been an new sense to me since I started with UiPath why should one declare things later.

@loginerror
As this feature is already in the backlog, could you help merge this post topic with Variable/Argument Type Inference

What is the best practice here when a duplicate request is made?

The answer for merging topics happens on a case-by-case basis (it kind of depends; we can only add the post from one topic under all existing posts of the other topic).

In this particular situation, I will simply close this topic and provide a link at the bottom to the earlier one.

Duplicated suggestion, see here: