You are viewing limited content. For full access, please sign in.

Question

Question

How to search for field with multiple values?

asked on January 23, 2015

What is the best way to search repository for field with multiple values populated?  Our date field was inadvertently checked to allow multiple values.  We do not want it to allow multiple values and want to change that, but there must be at least one field filled in as we are unable to check that option. 
 

Replies

replied on January 23, 2015

I don't think there's anyway to apply indexes to fields when using the search dialog, but you could use workflow to give you a list of them.

 

I would create a workflow:

------

that does a search for every document that has data in that field. 

then use that result in a for each entry loop

    Inside the for-each, retrieve that field. 

    create a token that uses that retrieved field token, that applies the value count function on it. 

    create a Conditional Sequence that uses a value count of greater than 1 

         if the conditional sequence matches, use the move entry to create a shortcut to the document in some directory

 

---

 

So now somewhere else you have a whole bunch of shortcuts for any documents with more than one date. Once you clean up all of those you can run a workflow that copies that information to a different field. Once you've copied everything over you can delete the original field and recreate it again as a single value, then run a workflow to copy that data from the different field back to the original.


It's all a pain in the rear process, but this would be what I would do to determine and correct the issue. I don't think you can make a multi-value field into a single field without a loss of data, which is why I suggest moving it to another field while you fix the original. 

replied on January 23, 2015

There actually a way to refer to the specific index of a multi-valued field. To find all documents where there are multiple values, you could use the following syntax:

{[]:[yourFieldName](2) = "*"}

Where the (2) signifies the second value of a multi-valued field and the "*" signifies any value.

You are not allowed to follow up in this post.