VMware Cloud Community
JeanChristopheD
Enthusiast
Enthusiast
Jump to solution

How to get an integer as default value for a Xaas item ?

Hi team,

I'm currently working with vRealize Automation 7.3.1 and vRealize Orchestrator 7.3.1 for some time and I didn't find how to get an integer as default value form a form item.

Let's review my current path.

In vRO, there is currently no "integer" :

no integer.PNG

Instead, there is the type "number" that is working as "integer" should : until there, no question.

When you want to introduce some dynamic in vRA, you may use actions.

Here the goal is to get a default value for the lease time regarding the environment where a vm deployment occurs : only 1 day on the DEV environment while 0 (unlimited) once in production.

I created a very simple action to do this that is enough to our demonstration : it returns "1" typed as "number".

action sending number.PNG

But when I try to bind it as the external value in the default value of my lease vRA item typed as integer, it fails, claiming that my action sends an "number" (that is true) while vRA expects an "integer" (that is correct regarding the type visible).

vra expecting integer.PNG

Let's note by side that vRA perfectly knows how to send its "integer" from a Xaas in the "number" input of a vRO workflow to conversion is definitely possible.

I'm open to suggestions, thanks for your help !

Reply
0 Kudos
1 Solution

Accepted Solutions
eservent
Enthusiast
Enthusiast
Jump to solution

Hello Jean-Christophe,

In fact, Number is not an Integer but a Decimal.

So, to match correct return field in VRA XaaS Form, you need to choose a Decimal input type.

And if you don't want to see "5.0" instead of "5", you should use a string type and parse it later as an Integer (ie parseInt(mystring, 10)).

It's what I did for CPU and Memory drop-down list.

Emmanuel.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Emmanuel.

View solution in original post

5 Replies
JeanChristopheD
Enthusiast
Enthusiast
Jump to solution

Hello,

After an upgrade from 7.3.1 to 7.4, the problem is still there.

Still open to suggestions 🙂

Reply
0 Kudos
JeanChristopheD
Enthusiast
Enthusiast
Jump to solution

Hi,

A little process for some who would like to replay the issue on their side.

Step 1 : on vRO side, create a simple action that returns a "number" and an empty workflow (to bind the coming xaas).

return 1;

0 - action to get an integer.PNG

Step 2 : on vRA side, create a new Xaas (bind it to the empty workflow previously created) and add an Integer field

1 - create a new integer field in a new xaas.PNG

Step 3 : enter whatever you want as name keeping the other elements as default

2 - enter the name.PNG

Step 4 : edit the element you just created and select the default value as an external input

3 - edit the object to selecte a default value from external.PNG

Step 5 : select the action you created at the begining that is supposed to send a number.

4 - select the action that send a simple number.PNG

Step 6 : submit and see the error

5 - submit and see the error.PNG

That's it, thanks for your ideas 🙂

Reply
0 Kudos
eservent
Enthusiast
Enthusiast
Jump to solution

Hello Jean-Christophe,

In fact, Number is not an Integer but a Decimal.

So, to match correct return field in VRA XaaS Form, you need to choose a Decimal input type.

And if you don't want to see "5.0" instead of "5", you should use a string type and parse it later as an Integer (ie parseInt(mystring, 10)).

It's what I did for CPU and Memory drop-down list.

Emmanuel.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Emmanuel.
JeanChristopheD
Enthusiast
Enthusiast
Jump to solution

Hi Emmanuel,

Thanks a lot for that perfectly working solution ! Infact I did not though that "number" could be something else than "integer".

Have a nice day 🙂

Reply
0 Kudos
eservent
Enthusiast
Enthusiast
Jump to solution

You're welcome.

Can you mark my answer as "solved solution", please ?

Thank you,

Emmanuel.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Emmanuel.
Reply
0 Kudos