VMware Cloud Community
SeanKohler
Expert
Expert
Jump to solution

OGNL IF Statement

Please share if you have figured out how (if possible) to use a conditional statement before a GetAction runs.

For example... this works fine.

adUserSearch.jpg

But if I want to only call the action if the searchTerm length is 5 characters, I cannot figure out a proper syntax to make that happen.  (Tried lots of ways... just not the right way--if one exists.)

adUserSearch2.jpg

1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

statement ? true : false

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

Reply
0 Kudos
4 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

statement ? true : false

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
SeanKohler
Expert
Expert
Jump to solution

Thanks Christophe.

I am missing something still.  It isn't working.

(#searchTerm.length > 5) ? GetAction("org.zzzzz.ActiveDirectory","getAdUserStringArrayByAdHost").call( #searchTerm , #adHost) : null

Reply
0 Kudos
SeanKohler
Expert
Expert
Jump to solution

Looks like I cannot get length this way...

#searchTerm.length

Reply
0 Kudos
SeanKohler
Expert
Expert
Jump to solution

#searchTerm.length()>5?GetAction("org.zzzzz.ActiveDirectory","getAdUserStringArrayByAdHost").call( #searchTerm , #adHost) : null

Just one of those mornings I guess. I got it worked out.  Thanks for the assist!