java - Return a list of SharePoint List Column Headers -
In Java, I have a connection to a SharePoint job and can get data in a list with a problem when I specify
The internal name of the data column is clearly below the array list list hash = new arrelist (); String view name = ""; GetListItems.ViewFields viewFields = Faucet; GetListItems.Query msQuery = Faucet; GetListItems.QueryOptions queryOptions = Null; String webid = ""; String line limit = ""; But I want to get those column names automatically from the SharePoint list so that I can read it more generally, and it is not particularly known that the column in the list What are the internal names of them before I can read them Any help is appreciated. Regards, I'm thinking that you can use the SharePoint Web Service If this is the case then you can try calling the GetList method method and for that method, you can pass the listname as a parameter. The result of web service will be the schema of your list, which will include the details of the list including the internal names of the column. Let me know that it works. GetListItemsResponse.GetListItemsResult Results = listoap.getListItems (List names, "", MSAPT, ViewFields, "150", QueryOption, WebID); Object list result = result.getContent (). Get (0); Element element = (element) result.getContent (). Get (0); Node list nl = element.getElementsByTagName ("z: line"); System.out.println ("\ n = & gt;" + nl.getLength () + "result from SharePoint Online \ n"); For (integer I = 0; i & lt; nl.getLength (); i ++) {named node map property = nl.item (i) .getAttributes (); // Add each field item in the array list string column name = "ows_lientName"; String columnname 2 = "ows_Address"; Println (attributes.getNamedItem (columnName1) .getNodeValue ()); Println (attributes.getNamedItem (columnName2) .getNodeValue ()); }
Comments
Post a Comment