Restrict possible values in lookup column dropdown to only approved items

Question

Tuesday, August 14, 2012 3:27 PM | 1 vote

I've got a time tracker list with a lookup column pointing to a list of projects.  I'd like to only include the projects that have been approved for use.  There's no filter option in sharepoint by default by the looks of things.

I think I've got the basic sharepoint installation to contend with and sharepoint designer isn't giving me an infopath option that was suggested in another post (unable to view link to full article due to proxy).

Does anyone have any newb-friendly techniques for restricting the values in a dropdown?

All replies (8)

Wednesday, August 15, 2012 8:40 AM ✅Answered | 3 votes

you can create a calculated column on projects list, this calculate with have blank value if the project has not been approved, and configure the tracker list to lookup to this calculated column.

Please refer to this similar thread: http://social.msdn.microsoft.com/Forums/en-SG/sharepoint2010general/thread/9986165f-ed60-4d9f-b14f-f1150608a0ce


Thursday, August 16, 2012 3:08 AM ✅Answered | 1 vote

since you cannot use the Approval Status in a calculated column, you may create a workflow to update your "calculated column":

  


Tuesday, August 14, 2012 4:17 PM

Modify the form using InfoPath.

In your List, click on the List tab, then Customize Form.

Select your dropdown, right click, Dropdown properties, in the Entries section click the box under Add...

With the Select a Field or Group window open, click Filter Data...

Here you can specify a filter to only show the items you are looking for.

 

If that doesn't work (with the InfoPath form still open), create a new Data Connecting (DC), select the field you want to see in the dropdown and the field you want to filter on.

Add a new dropdown to the form. Set its DC to your newly created DC, then retry the filtering outlined above.

www.SharePointed.com


Tuesday, August 14, 2012 4:18 PM | 1 vote

Unfortunately there is no easy OOTB way to do a filtered lookup.

There is this project - http://filteredlookup.codeplex.com/

You'll have to know a little CAML - but you could use: http://karinebosch.wordpress.com/my-articles/caml-designer/

To build the filter you needed.

- Vini Vidi Vici


Wednesday, August 15, 2012 8:55 AM

Modify the form using InfoPath.

In your List, click on the List tab, then Customize Form.

Select your dropdown, right click, Dropdown properties, in the Entries section click the box under Add...

With the Select a Field or Group window open, click Filter Data...

Here you can specify a filter to only show the items you are looking for.

If that doesn't work (with the InfoPath form still open), create a new Data Connecting (DC), select the field you want to see in the dropdown and the field you want to filter on.

Add a new dropdown to the form. Set its DC to your newly created DC, then retry the filtering outlined above.

www.SharePointed.com

I have the basic sharepoint installation so it won't let me utilise infopath as it does not infopath services running on it.  Thank you though for the quick response.


Wednesday, August 15, 2012 8:57 AM

Unfortunately there is no easy OOTB way to do a filtered lookup.

There is this project - http://filteredlookup.codeplex.com/

You'll have to know a little CAML - but you could use: http://karinebosch.wordpress.com/my-articles/caml-designer/

To build the filter you needed.

- Vini Vidi Vici

Thank you very much for the info.   These unfortunately require server access which I don't have (shoulda stated that in my original message!) so I'll have these as a fallback option.


Wednesday, August 15, 2012 9:00 AM

you can create a calculated column on projects list, this calculate with have blank value if the project has not been approved, and configure the tracker list to lookup to this calculated column.

Please refer to this similar thread: http://social.msdn.microsoft.com/Forums/en-SG/sharepoint2010general/thread/9986165f-ed60-4d9f-b14f-f1150608a0ce

Thank you for the link.  An inspired answer, but I'm coming up against a problem as it won't let me use the [Approval Status] column in the formula.  The formula written is...

=if([Approval Status]="Approved",[Project],"")

and the error message when I try to save the list in sharepoint designer is...

Could not save the field changes to the server. One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas.


Wednesday, August 15, 2012 3:02 PM

Because the Approval Status is a workflow column - you're going to be hard-pressed to filter or make a calculated column on that particular item.

So here's about the biggest Kluge that you could do, but it would get you what you need.

You could make different lists for the different status's of your item, basically clones of the same list. Part of the workflow would be to move the item to the appropriate list based on it's status.  Again not the best solution, but it would give you lists with only the items of each status type.

Ken Maglio SharePoint Architect Oakwood Systems Group blog: www.oakwoodinsights.com