1 2 Previous Next 15 Replies Latest reply on Oct 17, 2018 11:18 AM by JamesRogers

    How to use $(Owner) to show display name / full name not LoginID

    sibox Apprentice

      Hi People,

       

      When using $(Owner) inside a task details area of a workflow design, the value that is shown when viewed from in the task details when viewed from the service request is the LoginID of the user selected from the owner field on the service request. 

       

      What i would like to be shown is the display name / full name as it is  shown on the service request owner field. 

       

      Thanks in advance,

       

      Si

        • 1. Re: How to use $(Owner) to show display name / full name not LoginID
          daveb1 Apprentice

          Try using the expression $([Employee#.owner]DisplayName).  This leverages the relationship between ServiceReq and Employee using the field Owner_Valid -- the relationship is named ServiceReqOwnerEmployee -- however when you put it in an expression you use the Internal Reference Name.

          • 2. Re: How to use $(Owner) to show display name / full name not LoginID
            JamesRogers Rookie

            Does anyone know how to do what the original poster is asking? I could not get $([Employee#.owner]DisplayName) to work. It seems to operate at the service request level and does not pull any data on the first execution. If I rerun the workflow, it pulls the SR owner's Employee data (not the task assignee's employee data). I can access the task assignee's loginID using $([Task#Assignment.]Owner), but that is not a user-friendly value to send customers. Imagine getting "Hello John Doe, your website modification request has been assigned to ybarra". I cannot include phone or email info since those are also stored in Employee#.

             

            This is a snippet of the workflow. I am creating a task, but not assigning it. The SR owner will assign it. Then the workflow should send an email to the customer indicating who has been assigned the service request along with the assignee's phone and email.

            Task_Notification.jpg

            • 3. Re: How to use $(Owner) to show display name / full name not LoginID
              IJU Apprentice

              Hello James,

               

              the problem is that you are sending out an email from the SR level wanting to use fields from Task. SR to Task has a 1:n relationship so the SR looks at a number of n tasks to get the owner info which is not going to work.

              Why not send out the email straight from the task object itself? This way you can relate to infos from the SR (rembember 1:n means looking from task to SR give the task only the option of 1 possible SR, the parent) and you can use the info from the task itself.

               

              Kind regards

               

              Immanuel Jungheim

              Consultant

               

              ITSM Group – Be Better.

              www.itsmgroup.com

              • 4. Re: How to use $(Owner) to show display name / full name not LoginID
                IJU Apprentice

                Hello sibox,

                 

                maybe I don't understand your request but did you have a look at the picklist of the Task Owner field?

                What is the Display field set to?

                 

                 

                Kind regards

                 

                Immanuel Jungheim

                Consultant

                 

                ITSM Group – Be Better.

                www.itsmgroup.com

                • 5. Re: How to use $(Owner) to show display name / full name not LoginID
                  sibox Apprentice

                  Hi Immanuel,

                   

                          Sorry about that, it's not by best work. I'll put it a different way. My aim is to have a task in a WF and upon its completion, on the completed exit, have the next block an update which updates a field on the SR form to say the task has been completed and who completed it using an expression, along with some other approval info......

                   

                  $("Approved by Manager - " + GetSRPValue(RecId,  "HiddenManagerName") + "." +  "\r\n" + "Softphone Configured by - " +  ForEachChild("ServiceReq#",  RecId,  "Task#.Assignment",  $(Owner)) + ".")

                   

                  Which looks like this when the SR WF is ran....

                  Where it says MIU084,  i would like it say the display name of that user. Its nearly there just not quite.

                   

                  I did look at the picklist of the task owner field and it looks like.........

                   

                   

                  Which makes leads to to the question; If one was to change the value field to Display Name, would that have any effect else where in ISM?

                   

                  Thanks

                  • 6. Re: How to use $(Owner) to show display name / full name not LoginID
                    IJU Apprentice

                    Hi Sibox,

                     

                    thank you. That made it clearer

                     

                    You have two options here:

                     

                    1. Create a special "Owner_DisplayName" field in Task which gets the DisplayName value from the Owner each time the Owner changes. For this use a editing rule:

                    On Change of field: "Owner"

                    Set field: "Owner_DisplayName"

                    Expression: $([OtherObject]DisplayName)

                    This would of course mean to update the new field accordingly on all the tasks which are still going to be used for your function.

                     

                    2. Instead of referring to the Owner field in your expression use this function:

                    Old: $("Approved by Manager - " + GetSRPValue(RecId,  "HiddenManagerName") + "." +  "\r\n" + "Softphone Configured by - " +  ForEachChild("ServiceReq#",  RecId,  "Task#.Assignment",  $(Owner)) + ".")

                    New: $("Approved by Manager - " + GetSRPValue(RecId,  "HiddenManagerName") + "." +  "\r\n" + "Softphone Configured by - " +  ForEachChild("ServiceReq#",  RecId,  "Task#.Assignment",  $(EvalField("Employee#", Owner_Valid, "DisplayName")) + ".")

                     

                    And regarding your question to changing the Value Field to "DisplayName". I would not do that to be honest. the LoginId is unique and the DisplayName is not ... only if you configure it to be anyway. But not in the out of the box configuration.

                    So for now I wouldn't advice doing that.

                     

                    Kind regards

                     

                    Immanuel Jungheim

                    Consultant

                     

                    ITSM Group – Be Better.

                    www.itsmgroup.com

                    • 7. Re: How to use $(Owner) to show display name / full name not LoginID
                      sibox Apprentice

                      Thanks Immanuel for that.

                       

                      With option 1, i understand what needs to be done apart from from the last line "This would of course mean to update the new field accordingly on all the tasks which are still going to be used for your function.", not entirely sure what that entails.

                       

                      With option 2, when i simplify the expression i get the following message.....

                       

                       

                      Thanks

                      • 8. Re: How to use $(Owner) to show display name / full name not LoginID
                        IJU Apprentice

                        Hello sibox.

                         

                        Option 1: I meant that this new Owner_DisplayName is obviously not filled in Task records which have been created prior to you creating the new field.

                         

                        Option 2: That's unfortunate. Maybe have a look at the Admin Help. Maybe I messed up the syntax. (Employee#. with the dot for example). But it looks more like it not working at all, because it's not supported here

                         

                        Kind regards

                         

                        Immanuel Jungheim

                        Consultant

                         

                        ITSM Group – Be Better.

                        www.itsmgroup.com

                        1 of 1 people found this helpful
                        • 9. Re: How to use $(Owner) to show display name / full name not LoginID
                          sibox Apprentice

                          Hi Immanuel

                           

                          I see, i did think as much just not 100%. That will not be an issue as the RO and WF is still ongoing in staging.

                           

                          It's a shame that option 2 is not something that would work OOTB or something similar as i'm sure its not just me that would find that useful.

                           

                          Anyways thank you for your help and speedy replies!

                           

                          Also thanks daveb1 for your help.

                           

                          SiBox

                          • 10. Re: How to use $(Owner) to show display name / full name not LoginID
                            JamesRogers Rookie

                            Hello sibox and Immanuel,

                             

                            I am continuing to post here because we are dealing with the same problem: how to access the Employee# record for the task owner. This is my experience:

                             

                            Absolute Field Reference

                            It only works if I hardcode the task owner's loginID as in $([^Employee# where LoginID == "rogersja"]DisplayName).

                            I get the 'subexpression not allowed' error message using $([^Employee# where LoginID == $(Owner)]DisplayName).

                             

                            EvalField

                            I tried using $(EvalField("Employee#", Owner_Valid, "DisplayName")) from my notification block. It returned nothing.

                             

                            OtherObject

                            I tried using $([OtherObject]DisplayName) from my notification block and I got:

                            OtherObject_ParserError.jpg

                             

                             

                            • 11. Re: How to use $(Owner) to show display name / full name not LoginID
                              JamesRogers Rookie

                              Do you foresee a problem with creating a direct 1:n relationship between Employee and Task#Assignment instead of having to go through ServiceRequest? If that idea is an obvious disaster its just because I am new to HEAT and don't know any better.

                              • 12. Re: How to use $(Owner) to show display name / full name not LoginID
                                daveb1 Apprentice

                                Maybe it was a syntax thing or a version issue?  I am on 2016.2.1 and this validates with no errors warnings.

                                 

                                $("Approved by Manager - " + GetSRPValue(RecId,  "HiddenManagerName") + "." +

                                  "\r\n" + "Softphone Configured by - " +

                                  ForEachChild("ServiceReq#",

                                  RecId,

                                  "Task#.Assignment",

                                  $(EvalField("Employee#",  Owner_Valid,  "DisplayName"))) +

                                  ".")

                                 

                                I assume the period at the end is supposed to be outside of the foreachchild (really after the manager name).  But in the screen shot it looks like it is concatenated to the subexpression.

                                 

                                Here is a screen shot of this expression in my version.

                                 

                                1 of 1 people found this helpful
                                • 13. Re: How to use $(Owner) to show display name / full name not LoginID
                                  sibox Apprentice

                                  Hi daveb1

                                   

                                        The expression on your comment worked and the display name is showing as should .

                                   

                                  I worked out what i did wrong; when i used the expression suggested by IJU it said "Syntax Error: There are not enough right parentheses.⁽¹⁾".

                                   

                                   

                                  So i put it at the end of the expression, because that's where the (1) was, which shown the subexpression error:

                                   

                                   

                                  From your comment, the missing parentheses should of been placed after "DisplayName"))) and not "DisplayName")) + "."))

                                   

                                  $(EvalField("Employee#", Owner_Valid, "DisplayName")) + "."))

                                  $(EvalField("Employee#", Owner_Valid, "DisplayName"))) + ".")

                                   

                                  I should of looked at the syntax again properly and i would of seen where the suggested (1) was!.... the error message was putting me off.

                                   

                                  JamesRogers I hope this will also help you with your issue, the question you asked about 1:n relationships, i'm not in a position to confidently answer that, sorry.

                                   

                                  Thanks again everyone for your help.

                                   

                                  SiBox

                                  • 14. Re: How to use $(Owner) to show display name / full name not LoginID
                                    daveb1 Apprentice

                                    I have a suggestion on your problematic absolute field reference

                                     

                                    I get the 'subexpression not allowed' error message using $([^Employee# where LoginID == $(Owner)]DisplayName).

                                     

                                    Try

                                     

                                    $([^Employee# object Owner_Valid]DisplayName)

                                     

                                    The question will be context, in the service request context, it will be the owner_valid of the SR, or in the task.assignment context the owner_valid of the task.

                                    1 2 Previous Next