5 Replies Latest reply on Aug 8, 2018 2:47 AM by AlexIS&T

    Hide a dropdownlist in a template of a servicerequest / request offering

    AlexIS&T Rookie

      Hello ladies and gentlemen,   
      In a service request, I want to make an extra dropdownlist just like in this service request (see attachment)
      I have found where I can make the new dropdownlist but I want to show this dropdownlist only in 1 service request.   
      I understood that it is an adjustment in the template, which can be shown, based on file name  How do I ensure that this drop-down list only occurs in a number of service requests and not in all service requests?

      Thanks for helping out.
      Alex

        • 1. Re: Hide a dropdownlist in a template of a servicerequest / request offering
          Jonathan.Schmidt SupportEmployee

          Hi Alex,

           

          This got filed in the ITSM 6 & 7 forum space but your screenshot looks like ISM (version 20xx) product.  I'm moving it to the correct space to see if anyone has any ideas.

           

          Jon

          • 2. Re: Hide a dropdownlist in a template of a servicerequest / request offering
            dcogny Expert

            Hi Alex,

             

            In the "form" designer you just need to go to the "Visibility Expression" and set it to only show when the "Subject" of the Request is the specific you want:

             

            Hiding.PNG

             

            By default the visibility expression works by showing when the condition is met and hiding when it is not, if it is not working for you you can go with a full "if ... then:"

            $(If Subject == "QRT" then true else false)

            But, as long as it is working I prefer the first option, is clearer.

             

            Daniel.

            1 of 1 people found this helpful
            • 3. Re: Hide a dropdownlist in a template of a servicerequest / request offering
              AlexIS&T Rookie

              Thanks for the reply. Now I have a new challenge with hiding / showing a field.

              I want to show a field in two forms.

              Let's say the name of the forms are  "challengea" and a form with the name "challengeb"

               

               

              I tried

              $(Subject == "challengea"); $(Subject == "challengeb")

              $(Subject == "challengea") or $(Subject == "challengeb")

              $(Subject == "challengea" or "challengeb") but without success because the expression editer gives an error.

               

              Please help me with the syntax.

              Alex

              • 4. Re: Hide a dropdownlist in a template of a servicerequest / request offering
                dcogny Expert

                Hi Alex,

                 

                That's how we all learnt, facing the increasing difficulty challenges!   For a long time, learning HEAT was like a game to me, going from one level to the next!

                 

                The last one is pretty close to what you need, I think that the problem in your case was that you always have to tell HEAT what you are talking about, when you say "or 'challengeb'" HEAT does not know against what "chanllengeb" is to be compared. The second one was also close, but it has to all be in one expression (just one "$(XXXX)" for the whole situation), So:

                 

                $(Subject == "challengea" OR Subject == "challengeb")

                 

                You can also use the "in" or 'not in" to compare against a list, the list can be of as many items as needed:

                 

                $(Subject IN ("challengea", "challengeb", "challengec", "challenged"))

                 

                or

                 

                $(Subject NOT IN ("challengea", "challengeb"))

                 

                or fields

                 

                $(Status IN (AcceptedStatuses))

                 

                As long as "AcceptedStatuses" is a field in your object that stores some information like: "Submitted, Fulfilled, Closed" for example. (works too with validated fields, I use it sometimes with CurrentUserTeamNames to make sure that only people that are part of a specific team can get access/view to some parts)

                 

                Or you can use the 'case' command:

                 

                $(case "Subject"

                when "challengea" then true

                when "challengeb" then true

                when challengec" then true

                else false)

                 

                Although to be honest, I would use case for situations where the outcome changes depending the case, for you current case I would go with the first or second options (second is clearer if you expect the list to keep increasing over time):

                 

                Set Priority by time to reach a specific date:

                 

                $(case ScheduledDate

                when Now(-10) then 5

                when Now(-7) then 4

                when Now(-5) then 3

                when Now(-2) then 2

                when Now() then 1)

                 

                or

                 

                $(case

                when ScheduledDate < Now(-10) then 5

                when ScheduledDate < Now(-7) then 4

                when ScheduledDate < Now(-5) then 3

                when ScheduledDate < Now(-2) then 2

                when ScheduledDate < Now() then 1)

                The examples are not great, but I could not come up with better ones

                 

                You can also use nested if's (this is more useful if you want to check different conditions):

                 

                $(if Subject == "challengea" then true

                else if Subject == "challengeb" then true

                else if Status == "Fulfilled" then true

                else false)

                 

                Notes:

                 

                • You can combine the first examples with the last ones:
                  • $(if Subject == "challengea" AND Status == "Submitted" then true else false)
                  • You can combine ANDs and ORs, but that gets a bit tricky, make sure to use parenthesis properly (I personally never combine them, I prefer to use nested if's for similar, but more manageable outcome).
                • AND and OR can be replaced with && and || respectively:
                  • $(if Subject == "challengea" && Status == "Submitted" then true else false)
                  • The two examples are exactly the same for HEAT
                • Be very careful with the parenthesis, although HEAT does a good work pointing out where you have some missing (it does not let you save if they are not enough), HEAT only makes sure that you have enough, is up to you to know if they are in the right places.

                 

                Hope this helps you with your challenge!!

                 

                Daniel.

                1 of 1 people found this helpful
                • 5. Re: Hide a dropdownlist in a template of a servicerequest / request offering
                  AlexIS&T Rookie

                  Thanks for the extensive explanation Daniel.
                  I appreciate this.