VMware Cloud Community
cschn
Contributor
Contributor
Jump to solution

How to show a variable in Input Form

Hi

When I start my Workflow, I read a JSON file from a Ressource Element, see example below. Now I want to to display the "JSON-Version", which is included in the JSON file, at runtime in the Workflow Input Form as a controll for the user.

Is this possible? If yes, how?

{

   "JSON-Version": "1.0",

   "hosts": {

        "host": {

             "hostname": "192.168.1.111",

             "username": "admin",

             "password": ""

          }

     }

}

Any advise will be appriciated!

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

What kind of control do you want to show?

In the simplest case, if you just want to display it on the form as a simple text, you can do it by:

  1. Create a vRO scripting action (return type - string) and inside it, add some scripting code that will read resource element, fetch the JSON-version attribute, and return it as a string
  2. In the workflow input form, add a new Text Field element, then in its properties' Values tab select 'Value source' to be 'External source', and in 'Select action' choose the action created on step 1

That's it. Now, when you run the workflow, you should see the value read from your resource element shown in the UI text field control.

View solution in original post

2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

What kind of control do you want to show?

In the simplest case, if you just want to display it on the form as a simple text, you can do it by:

  1. Create a vRO scripting action (return type - string) and inside it, add some scripting code that will read resource element, fetch the JSON-version attribute, and return it as a string
  2. In the workflow input form, add a new Text Field element, then in its properties' Values tab select 'Value source' to be 'External source', and in 'Select action' choose the action created on step 1

That's it. Now, when you run the workflow, you should see the value read from your resource element shown in the UI text field control.

cschn
Contributor
Contributor
Jump to solution

Hi Illian

That was exactly what I looked for. It works very well.

Actually I'm working with vRO 8.0.1 and the HTLM5 interface is a bit strange to me. Especially since there is no good documentation available, or I was not able to find one.

Thank you very much, you saved me a lot of time 🙂

Greetings

Chris

Reply
0 Kudos