I have two lists,
List A [Document Number, Name, Title,...] (document library) List B [Information Number, Name, Title, Document Number] (simple list)
Now List B is getting all documents from List A as lookup column and letting user add documents name to List B specific Information Number, which can have 0, 1 or many documents.
I wonder what would be the best way to get all lookup fields values (document's name but no duplicates) that are associated with any Information Number item in a ascending order by Information Number.
List B, Item A - Document 1, Document 9, Document 3 Item B - DOcument 2, Document 3, Document 4, Document 5 Item C - Document 1, Document 5, Document 9, Document 0.8
Now the output I would like is something like this,
Document 1, Document 9, Document 3, Document 2, Document 4, Document 5, Document 0.8
Can I use CAML query or through C# code, and an example code would be appreciated.