Making Soap Requests still works on SharePoint Online

I was getting individual fields from a Sharepoint List and the SOAP request (old code) needed the viewId (a GUID) and it took a long time to find it. It is quite easy to find (now that I found it once) but if you go to the classic view and click Library->ModifyView and scroll all the way to the bottom-right – you will see your viewId in url-encoded text at end of the URL. Done. Its tricky to know what GUID was being sought and it wasn’t on my blog – so it took longer. Never again 😉 You can stop reading but below is the context in which the viewId is needed.

Here is the full SOAP request in case

Private Function GenerateSOAPBody(viewId As String, valueToGetHere As String)
    Dim req As String
    req = "<?xml version='1.0' encoding='utf-8'?>"
    req = req & "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "
    req = req & "xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
    req = req & "<soap:Body><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> "
    req = req & "<listName>DefaultConfigList</listName><viewName>" & viewId & "</viewName><query><Query xmlns=''><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" & valueToGetHere & "</Value></Eq></Where><OrderBy><FieldRef Name='Title' /></OrderBy></Query></query>"
    req = req & "<viewFields><ViewFields xmlns=''><FieldRef Name='ID' /><FieldRef Name='textValue' /></ViewFields></viewFields><ViewFieldsOnly>true</ViewFieldsOnly>"
    req = req & "</GetListItems></soap:Body></soap:Envelope>"
    GenerateSOAPBody = req
End Function