Returning unique values

Forums SPJS-Lookup Returning unique values

This topic contains 4 replies, has 3 voices, and was last updated by  Alexander Bautz 1 month, 3 weeks ago.

  • Author
    Posts
  • #7202

    Jeff Law
    Participant

    Hi,
    I was wondering whether it would be possible to add an option that enabled only unique values to be returned in the lookup list.
    My scenario is that I am using a Contact List to return the list of Companies, but of course there are often several people from the same Company, so I get one Company for each entry. What I am really after is just the one entry for each Company.
    Regards
    Jeff

  • #7232

    Alexander Bautz
    Keymaster

    Hi,
    Have you tested it? – I’m fairly sure this solution will remove duplicates so that only unique values show in the dropdown.

    Alexander

  • #7238

    Jeff Law
    Participant

    Indeed it does! My problem was that the test data I was using had trailing spaces after some of the “duplicate” entries.

    Not a problem now that I know to check for it 🙂

  • #25882

    Ray Stopa
    Participant

    Is there a way to do the opposite of this? For example I am using SPJS.lookup to pull in a list of open jobs. Some jobs have the same name but different departments or different managers. I can figure out some javascript solution to match up the job to the department or manager but still need a way to show all the jobs in the drop down even if they have the same name. Thank you!

  • #25887

    Alexander Bautz
    Keymaster

    Unfortunately there is no setting to let you return duplicate values, but if the values were duplicated, how would the user know which one to select?

    I suggest that you create a calculated column to use as source – including the department – and then your values are unique and all will show.

    Alternatively you can use the cascading dropdown plugin and have department in level one and job name in level two.

    Alexander

You must be logged in to reply to this topic.