Solved

Form lookup with "Contains"?

  • 13 April 2017
  • 8 replies
  • 175 views

Userlevel 5
Badge +13

We have a use case to pull in a lookup from another list where a field on that list contains a field of this list. That sounds confusing, so let me elaborate. We have a list called "Minutes." On that list, there is a multi-select lookup where you pick from a list of "Requests" to indicate which requests were discussed in this meeting. We then want to surface any meeting minutes relevant to this Request on the form of that request. How can I accomplish this cleanly?

icon

Best answer by courtney_shelto 27 April 2017, 15:48

View original

8 replies

Badge +1

I can imagine that you can select values from a list of requests in the form and then you save the form. A workflow could search through the list of meetings and enter all related meetings in a field "related meetings".

I have no idea how to solve this on the fly while the form is open.

Maybe you have to discribe your use case in a numbered list (step 1. to 9.) or similar?

Userlevel 5
Badge +13

What type of field would you have the Workflow write the "relevant meeting minutes" into to be able to click on them and go to them from the form of the request? For this to not update on the fly is fine with me. It could update as new meeting minutes were added. I envision the process like this:

1. A request titled "Test Request1 is entered"

2. Meeting minutes, MM1, are entered and in the "Discussion Topics" field, they select that "Test Request1" is one

3. User goes back to the request form "Test Request1" and now, there is a place on the form "Relevant Meeting Minutes" under which, MM1 is listed and clickable to go open the MM1 form. 

The one way I thought of accomplishing it, was on the MM1 form, have a workflow run on creation (possibly modification, in case users go back and add "Discussion Topics" later) that finds the Requests that are selected in the Discussion Topics and writes to a field on that request that includes the just submitted Meeting Minutes. I can split the "Discussion Topics" into a dictionary (they are a comma separated string by default), then have a query that looks for request title == dictionary[0], then somehow write into the field the hyperlink to the meeting minute I just ran this on. My hangup with this process is what type of field to use that can nicely display this without having 10,000 fields (one for each relevant meeting minute).

Badge +1

I am only using SharePoint 2010, but maybe you can do similar things:

a) Create a view of your "Minutes" and add a webpart on top based on the request list. In the context menu of your "Minutes" you should find "Connextions > Get filter value from > Request List". A dialog will ask you which fields to use. When this page is shown, you select a request in the upper list and the minutes list below gets filtered ... - or:

b) You use field type "Lookup" in list "Requests" going to list "Minutes" with option "Allow multiple values". Each time an item of "Minutes" is saved the assosciated workflow should add its ID into the lookup field of all related requests. Of course, you should first remove the ID if available to avoid redundant entries.

Note: For SharePoint 2010 you can do special things as described in this video https://www.youtube.com/watch?v=6BzXD22E8qA - but I doubt that this works for Office 365, too.

Hopefully you find something that works for you. The option to connect webparts is something that I was not aware for a long time.

Userlevel 5
Badge +13

Hey ,

I don't think the first one will work for us as I'm trying to do this on the actual request form itself. As for option b, could you go into some more detail on how to implement that? I've tried a couple different things but I think I must be missing something.

Badge +1

I am sorry to here that you are still stuck at this problem.

Request form: do you use the SharePoint form display (native) or a Nintex form? I have no experience with Nintex forms, we use 95% SharePoint native forms and 5% InfoPath forms.

This is how I create lookup fields with multiple values:

SharePoint 2010 > Insert Column > Lookup with Multiple Values

And this is an example in Nintex 2010 used to find values with Query XML (in case of an InfoPath form that stores data as XML) which stores data in an array, and to run a for-each loop that processes each item in the array - either remove or add as required.

Nintex Example

Userlevel 5
Badge +13

Hello Gunnar,

I set it up similarly to you (the column was identical), but can you go into more detail on your individual workflow actions? What values are you querying with that XML? The way I had set up my workflow, was on the minutes list, when a new item was created, I looked at the "Discussion Items" field (which is a lookup on the requests list and the person entering the minutes can select multiple, basically to say which requests were talked about at the meeting). I then query the requests list for each of the discussion items that were discussed, and add the new meeting minutes to it, but I did update list item and add ID of current item. This didn't seem to have an effect, as far as I could tell.

Userlevel 5
Badge +13

Alright, got this sorted. I ended up putting a WF on the Minutes list that checks all the "Discussion Items" that have been selected, splits them (they're a string with commas) into a collection, and for each of them, goes and writes the name/URL hyperlink of the newly added minutes into a rich text field on the relevant/related requests using <a href=></a> style tagging. Unfortunately, this doesn't allow me to remove duplicates, so I have it only run on creation, meaning if it's edited later and new discussion topics are added or removed, it won't pick up on that. On the requests list, I made the rich text field not be editable by users either so it looks clean (always shows in display) and clickable, even in edit.

Badge +1

I am glad you found a first version that runs ok with some drawback.

When I run a workflow and it does not work as intended then I use the "Log in the History List" function to store varibale values and some text where I am in the workflow. Maybe you mixed some values or a variable hold data in the wrong format?

Good luck!

Reply