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" :
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".
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).
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 !
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.
Hello,
After an upgrade from 7.3.1 to 7.4, the problem is still there.
Still open to suggestions 🙂
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;
Step 2 : on vRA side, create a new Xaas (bind it to the empty workflow previously created) and add an Integer field
Step 3 : enter whatever you want as name keeping the other elements as default
Step 4 : edit the element you just created and select the default value as an external input
Step 5 : select the action you created at the begining that is supposed to send a number.
Step 6 : submit and see the error
That's it, thanks for your ideas 🙂
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.
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 🙂
You're welcome.
Can you mark my answer as "solved solution", please ?
Thank you,
Emmanuel.