Skip to main content
Question

How to verify a variable input before runbook execution

  • Nov 28, 2023 9:02 AM UTC
  • 4 replies
  • 124 views

Avico

Hi,

My challenge is to verify a user’s input before she clicks ‘execute’ 

For example: I’ve created a variable named MyNumber with Data type = integer

I want to verify that the provided value should not be higher than 3

Using input type as Escript, I’ve tried:
if @@{MyNumber}@@ > 3:

    print(3)

But when executing the runbook I get the warning that I have a cyclic dependency and the input is not available.

Is there a way to achieve this input verification?

Thanks

This topic has been closed for replies.

4 replies

JoseNutanix
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • Dec 19, 2023 10:03 AM UTC

Hi Avico,

My suggestion is to use the regular expressions option available in variables.


Avico
  • Author
  • Trailblazer
  • Dec 19, 2023 3:48 PM UTC

Thanks Jose,

I really hope Nutanix is working on improving the coding environment for developers. It is definitely lagging behind…

 

Avi


JoseNutanix
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • Dec 19, 2023 3:50 PM UTC

Hi Avico,

We’d like to hear more about what sort of capabilities you are looking for, since we have been actively improving our DevEx with many developments happening at the moment around our v4 APIs, Terraform provider, Ansible collection, PowerShell, Calm DSL and more.

Looking forward to hear more from you!


Avico
  • Author
  • Trailblazer
  • Dec 19, 2023 4:24 PM UTC

Thank you Jose!

Will write you an email with the things I think Self-Service’s coding environment can improve on… :-)

Avi