UDA Person or Group Variable


Userlevel 4
Badge +10

Hi Folks,

Looking for a workaround to the limitation of not being able to create a Person or Group variable/Parameter in a User defined Action. I want to create a UDA that will capture the last task modifier from the Workflow Tasks list. I can get the value but I want to get the user's display name. Any thoughts?

Thanks,

Patrick


11 replies

Userlevel 5
Badge +14

just a thought, haven't tested it - what about first assign user's display name to a text variable (that should allow you to select output format to be display name) and then supply that variable to  UDA as input parameter?

Userlevel 4
Badge +10

Hi Marian Hatala,

Thanks for the response! I am not sure how to do that inside of a UDA. Since the PG data type is not accessible inside a UDA, the display name property is not either as far as I can tell.

Thoughts?

Patrick

Userlevel 5
Badge +14

I'm sorry, I uderstood you just need pass a user display name into to the UDA (aka filling input parameter).

if you need to do transformation with UDA, then I affraid you will have to use webservice call or LDAP query.

you might get idea here Retrieve a user's Display name from their login

Userlevel 4
Badge +10

Yes, I could do that but that is the UDA I am trying to build so that I do not have to do that for each task outcome branch I create. The actions I configure again and again are the query list (to get the modified by Person or Group and the outcome in the task list), then the set variable to get the display name from the Person or Group value.

Userlevel 5
Badge +14

then you may not to include your final set variable into UDA.

sound to me still better option do the display name lookup everytime in main workflow then build complex logic in UDA.

Userlevel 4
Badge +10

That would really defeat the purpose though as the point of this UDA was to avoid that. Unless someone has a workaround idea, this may not be a UDA that I can create.

Userlevel 6
Badge +12

Hello Patrick Kelligan​ -

If you are looking to query your Workflow Tasks list and pull back the last user that modified an item within the list, and get their display name, you can do this all in a UDA in 3 steps:

182201_pastedImage_0.png

Step 1 - Query the list

Seems striaght forward enough, pick the list you want to query and filter/sort it how you want. If you want the last user, I would recommend that you sort by [Modified] in descending order to ensure you get the latest one. Next grab the [Modified By] user and store it in a variable.

Step 2 - Call web service

This gets a bit tricky, but is easy enough. You are going to want to call the GetUserInfo method in the Usergroup.asmx. You will have to provide credentials and then select the method from the drop down. Next feed in your variable into the web service input for userLoginName (string) and then select your output variable. Keep in mind, your output will be in XML!

182202_pastedImage_1.png

Step 3 - Query XML

Lastly, you'll need to query your XML to get the specific element you want. I would recommend that you take a look at the raw XML to ensure that you are getting the correct data (this can be done by using the Run Now options in the web service to get the XML and the query XML to see the final product). Once you have the specific element picked out, add in your XPath (probably something like //@Name). Save your result in your output parameter for your UDA and your done!

182203_pastedImage_2.png

This UDA can be dropped into any workflow and will provide an output of the last user to modify an item in the Workflow Tasks list as a display name, like so:

182205_pastedImage_3.png

Hope this helps!

Userlevel 6
Badge +12

Hello Patrick Kelligan​ -

Were you able to get this working or find a solution?

Let us know!

Userlevel 4
Badge +10

Hi Jesse,

I have been on travel and just got back into the office. I have not looked into your idea yet. I will try and work it out by the end of this week and let you know.

Thanks so much for your response!

Patrick

Userlevel 4
Badge +10

Hi Jesse McHargue,

There were a few persnickety little details to work out but essentially you solution worked for us. Thanks for the valuable input!

Best Regards,

Patrick

Userlevel 6
Badge +12

Excellent! Glad to hear it!

Happy Nintexing!

Reply