Skip to main content
Question

SharePoint - Error Actions

  • July 8, 2026
  • 4 replies
  • 54 views

We are using SharePoint authentication via an OAuth connection. To do this:

We created an enterprise application in Azure with the following information:
* The control room’s callback URI.
* The following permissions: Offline_access, Openid, Profile, User.Read, Sites.FullControl.All, Sites.Read.All, Sites.ReadWrite.All, AllSites.Manage
* Delegated permissions

We created an OAuth connection in the control room with the following settings: Microsoft Azure AD, Authorization Code Flow, client ID, client secret, Authorization URL, Token URL, Scope https://graph.microsoft.com/.default; we also assigned roles.

We tested SharePoint authentication, and it works correctly, but when we run an action such as retrieving folders, we get an error.

We tried with “Shared Documents” and got the same error. We also tried to retrieve the lists from the SharePoint site, and it returned 0, even though several lists have been created.

4 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • July 8, 2026

@carlos.ortiz It must be SharePoint day today. We are already talking about this topic, so please continue the discussion here:

In short, get the “Get folder(s)” action working properly first, then work on the rest.


  • Author
  • Cadet | Tier 2
  • July 8, 2026

But, actually this discussion don´t resolved the initial problem


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • July 8, 2026

@carlos.ortiz Fair enough. 

To be honest, it just takes a lot of experimentation to find just the right path. The error you’re seeing is that you’re not pointing to a correct path.

It took me about 30 minutes to find a combination that worked with our SharePoint connection. Here’s what I found:

  • The Subdomain in the Authentication action should only be one word. It should be the word here in your SharePoint URL:

    https://THIS_WORD.sharepoint.com/…
     
  • I used the Get folder(s) action to test my connection. For Site, I chose “Other site” and specified the word from this URL:

    https://abcd.sharepoint.com/sites/THIS_WORD/...

    I then specified a folder path of Documents.

Beware that the Get folder(s) action returns a List variable that must have a subtype of “All”. Then, if you loop through that List, the current item must go to a Dictionary variable with a subtype of “All”. The initial List variable AND the Dictionary variable will have embedded Dictionary variables within, hence the need for type “All” rather than String as you might expect.

Once you get this working for the Documents folder, you can experiment for other others. Just know, with SharePoint, there is no “magic bullet” that works every time. It takes time and experimentation to make it work. SharePoint’s flexibility means extra complexity and difficulty for us as developers.


  • Author
  • Cadet | Tier 2
  • July 8, 2026

Yes, I configured the authentication activity correctly with the subdomain and the SharePoint site; it authenticates without any issues. However, when I use actions such as:

* Get list(s), it returns a list with 0 items even though the SharePoint site has more than 5 lists.
* “Get Folder(s)”—when I specify the folder path “Shared Documents/Test”—returns an error stating that the folder does not exist.

I’m checking to rule out the possibility that there might be permission issues in the Azure application where administrator consent hasn’t been granted for the necessary permissions.