Lookup function return user display name

  • 6 January 2016
  • 4 replies
  • 1 view

Badge +4

Good day everyone,

I have an interesting question for the form I'm currently working on. I want to display the person occupying a role in a workflow initiation form. Instead of modifying the form each time the person in that role changes, I'd like to perform a lookup on another list to retrieve that person's name.

I'm not having any issues retrieving the information, but the value returned is in [1;#LName, FName] format, but I'd like to get the display name instead. Is this possible or should I just add an extra field in my list to hold their name how I want it displayed?

Thanks,

Daniel


4 replies

Badge +4

This would work if I was using the lookup in the workflow, but this lookup is to display the person occupying a role (designated in another list) on an initiation form. I can only connect the calculated value to list columns, and the data can only be saved as string, int, decimal or currency.

Badge +4

Updated explanation:

I am using a Calculated Value Control in my workflow initiation form to show the name of a user in another list. There is no option to pass a calculated value on to a workflow variable. I could pass it to a list column, but my goal is to show the display name on the initiation form, so this does me no good. I was hoping that perhaps there was a way to choose the output column's return type. Perhaps something like:

lookup(list title, column to filter on, value to filter on, output column:return type)

I have 17 roles on the initiation form to choose from.

My initiation form has 17 choices displayed as follows:

[Label]: [Calculated Value] [bool]

Badge +4

Soooo... my workaround was to add an On Modified WF to the Executives (lookup) list to populate a hidden Display Name field whenever the executive is changed. I then return that field in my workflow initiation form calculated value control lookup.

It would be nice if I could have just selected the return type I required...

Badge

You can use the parseLookup() function to get rid of the list ID and ";#" . For Example,

parseLookup(lookup("mylistname", "ID", "10001", "Created By")).   This is much easier than creating another calculated column.

Reply