I have a list which contains a LookUp field from another list. What I want to do is get the value of this column using the usual ListService.GetListItems. But the data I get is null. Same thing happens when I try to get the value of a calculated value field, I get a "float;#17.97000" (17.97 being the value).
Can I manage to get those fields correctly?
public List<Cartridge> getData() { XmlDocument xmlDoc = new XmlDocument(); XmlNode query = xmlDoc.CreateNode(XmlNodeType.Element, "Query", ""); XmlNode viewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", ""); query.InnerXml = "<OrderBy>" +"<FieldRef Name='Imprimante'/>" +"</OrderBy>"; viewFields.InnerXml = "<FieldRef Name='Title'/>" +"<FieldRef Name='Imprimante'/>" +"<FieldRef Name='Stock'/>" +"<FieldRef Name='Fournies'/>" +"<FieldRef Name='PrixUnitaire'/>" +"<FieldRef Name='PrixTotalFournies'/>"; XmlNode listItems = ListService.GetListItems("Cartouches d'encre", null, query, viewFields, "10000000", null, null); List<Cartridge> cartridges = new List<Cartridge>(); for (int i = 1; i != listItems.ChildNodes[1].ChildNodes.Count; i += 2) { cartridges.Add(new Cartridge(listItems.ChildNodes[1].ChildNodes[i].Attributes[0].InnerXml, listItems.ChildNodes[1].ChildNodes[i].Attributes[2].InnerXml, listItems.ChildNodes[1].ChildNodes[i].Attributes[3].InnerXml, listItems.ChildNodes[1].ChildNodes[i].Attributes[4].InnerXml, listItems.ChildNodes[1].ChildNodes[i].Attributes[5].InnerXml)); } return cartridges; }