I have queried Active Directory to get location field. Location field has multiple values, on my nintex form I have to somehow display those multiple values as choice or some other nintex form item types. Each user who logs in has a different multiple value for location. How do I implement that?
We had a similar requirement and we implemented the below logic with Nintex Form 2013. Please find the details:
1. After retrieving the value from the query to a collection variable (say: wvLocationColl)
2. Use 'Set Variable' action and assign this collection variable to single line text variable (say: wvLocationStr)
wvLocationStr values equal wvLocationColl
3. Now open the task form in the designer mode and add a 'Choice' control to the form. In the control setting under Choices option use this single line text variable(wvLocationStr)
4. Publish the workflow and verify if it works. We have tried this in out environment and it works without any issues.
Thanks so much, this collection is going to be displayed in starting Form not in Task Form. Do you think it is a good idea to save the collection value in a list item with single line of text type. and then add a choice to the starting form?
I have created a form based on my list and I would like to display it there. I thought the starting form would be the form I designed for the list, but after I checked I noticed the form is not the same.
Workflow start form cannot be a list form. They are two different forms. If you want to use Nintex form for a list form, you should use Nintex List Form and not the workflow start form.
Regarding saving the collection variable in a single line text, frankly speaking I have never tried this. You can give a try on this.
Alternatively, I have another approach to accomplish this requirement by using list look up control. To do this you need to follow below steps:
1. Create a custom list by name 'Location' and the 'Title' column be a only column in the list.
2. Now you need to modify the workflow which queries the AD and gets the location values in to the collection variable.
a. After retrieving the values in to the collection variable, check if items present in the 'Location' list. If yes delete all of them
b. Loop through each collection variable value and add them as separate items in the 'Location' list, (If there are 5 locations entries in the collection variable then there should be only corresponding 5 entries in the '
c. Commit the changes
3. Now in the start form, add a list look up control which will use 'Location' list as the source list and 'Title'column of the location list as the values of the look up.
4. By doing this, you are maintaining a separate entry for the location list which will help you in better maintenance.
This is one kind of solution of this requirement. There may be many other approach to achieve this.