Is it possible to set conditional metadata for a document?

For instance, there are three metadatafields in my document: accountnumber, projectnumber and casenumber. A user can fill all three metadatafields but is required to fill at least one.

  • Just make the columns not required, or am I missing something? Jun 12, 2013 at 12:09
  • Yes, if I do that the users are able to fill in no information at all. I want to restrict that to filling at least one of the three.\ Jun 12, 2013 at 13:25
  • OK, then I understand, and i think Daniels answer points you in the right directions Jun 12, 2013 at 13:27

2 Answers 2


The best way I can see to do it is to add event receivers onto ItemAdding and ItemUpdating which checks to see if at least one of the three fields is populated, and if they are not, refuses to continue to add/update the item in question. You will probably want to implement some kind of warning in the form of a pop-up box or, if you want to be really fancy, an email that says why the add/update failed.

  • Sounds like a plausible solution, I am going to try to implement this. I was afraid it couldn't be solved without some custom code. :) Jun 12, 2013 at 15:29
  • Yeah, I admittedly probably think code first more than I have to but I am not off-hand aware of a way to solve this without custom code. Jun 12, 2013 at 15:30

This requires a change in the new/edit form for that library, by e.g. inserting javascript that checks if 1 of the 3 fields has content. This is done through SharePoint Designer.

  • Hmmm, don't think that will work. It is corporate metadata, used in lots of libraries. Further it will not restrict uploading from SP Workspace or via a webservice. Possibly other options. Jun 12, 2013 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.