How to create a Switch Statement in the workflow that acts on a custom field across all ordered Catalog items.

willkara
Kilo Contributor

So we have a number of Catalog items that are order-able. They can range from Windows/Linux servers to database servers ...etc.

We've successfully created them in the catalog and are starting to create their forms and create the workflow for them. I was hoping to have a single workflow for all of the items that follows a single idea. Please see the image below.

WorkflowIdea.png

Each catalog item has a field that is hard-coded into it, a Service Identifier. We don't have it as a choice field or anything like that, just a simple Text field that we set a default value into and make it ReadOnly.

I'd like to create a Switch/Case statement that allows me to put in a condition for each separate identifier. I'm able to create the Switch statement now, but it makes me select a Service Identifier field on a specific Catalog Item.

serviceIden.PNG

Is there a way to make it possible to select the Service Identifier field from EACH item and create the Switch/Case statement for that? I could simply add a condition on the Switch/Case but I'm still left with the Always action. Something like this:

switch serviceIdentifier:

        case "this one":

                  do blah;

        case "that one"

                  do blah2;

- Will

It's not an Out-Of-The-Box field. It's a field that we have put in ourselves. Message was edited by: William Karavites

1 ACCEPTED SOLUTION

Ok, so if your user is to have no interaction with this field, then why make it a variable in the first place?
Why not just do evaluations in the workflow that ask what Catalog Item it is and branch logic from there (using IFs or Runscript)


View solution in original post

11 REPLIES 11

Hmm. Not sure if I understand the problem. But how about making a custom field on Requested Item(RITM) which I guessing you are using. Having the service identifier fill in that field. Then you should have no problem doing a switch in that field.



or am I missing somethingf?



//Göran


What I don't understand about the Switch/Case block in the workflow is how it relates to the Choice list for the variable.



I had just created a Variable in a Variable Set and connected it to a table which held the possible values. I had entered in a few test values and they still didn't show up as options when I went back to the Workflow Editor to create the Switch/Case block.



Even if I do get that get figured out, I still have the problem of setting a default value for each item. If an item is in a variable set, then you can't set defaults per item....correct?