
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 05:33 AM - edited 03-01-2019 06:26 AM
I'm having trouble trying to integrate (what I think should be) a simple if/else statement in a workflow. The documentation on this seems pretty lacking.
I created a new workflow called ifelsetest with a user input of catalog as "SelectOS". I want to do an if/else based on if this input contains "Win."
So far every time either the if/else statement fails when it runs, or it always evaluates to false even when the Select OS category is something like "Window 2008".
What should the evalutation statement be to execute this? If I try SelectOS contains "Win" it evaluates false. I've also tried ifelsetest SelectOS contains "Win" which just fails to execute.
Solved! Go to Solution.
- Labels:
-
UCS Director
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:16 AM
Are you sure the variable contains words rather then a number and what does the exact statement look like you have I. The If Statement?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:16 AM
Are you sure the variable contains words rather then a number and what does the exact statement look like you have I. The If Statement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:20 AM
If I look at workflow properties, there is just the one input variable (catalog) and it is labeled SelectOS. It actually had a space before and I deleted the space just to see.
The exact if statement is:
SelectOS contains "Win"
And using this statement, if I select a catalog item like Windows 2008 it evaluates to false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 03:19 PM
The cAtalog selections all result in numbers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:22 AM
Oh you may have been saying, am I sure that the contents of SelectOS are words and not a number? No I'm not. I'm choosing words from a list but maybe the actual content is some sort of ID number.
Is it possible to debug or break to find out the value?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:25 AM
Try this? Variable is called out with ${}
$ contains “Win”
Patrick Horner
Systems Engineer
Sales / Channels
pahorner@cisco.com<mailto:pahorner@cisco.com> (epage)
Tel: +1 408 894 3613
CCIE - 13274
<sip:pahorner@cisco.com>[http://www.cisco.com/c/dam/m/en_us/signaturetool/images/icons/webex.png]<http://cs.co/patrickhorner>
Cisco Systems, Inc.
12515 Research Blvd., Building 3
78759 Austin
Texas
78759
United States
Cisco.com<http://www.cisco.com/>
Download vCard
Think before you print.
This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.
Preferences<http://www.cisco.com/offer/subscribe/?sid=000478326> – Unsubscribe<http://www.cisco.com/offer/unsubscribe/?sid=000478327> – Privacy<http://www.cisco.com/web/siteassets/legal/privacy.html>
Please click here<http://www.cisco.com/c/en/us/about/legal/terms-sale-software-license-agreement/company-registration-information.html> for Company Registration Information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:28 AM
not sure why my email broke my reply...
try:
${SelectOS} contains "Win"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:43 AM
This gives the same result as not using the ${} notation. It seems to always evaluate false.
Maybe it is true that the SelectOS variable actually contains some kind of numerical ID. Is there an easy way to check what the value of this variable is while the workflow is executing?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 03:20 PM
Sr log

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 03:19 PM
Yes in Sr log you can see the numbers or words selected or in the sr input output section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 06:52 AM
You were right. I changed the input to admin input and selected the entry, and the output is actually a numeric ID so it wasn't matching up with the text. I modified the match statement to the number and it worked fine.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2017 03:20 PM
Super cool.
