Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
benjamin183
New Member

Continue query by unauthorized or try and catch?

Hi everbody, 

 

I have SharePoint List with two columns title and url. The url column has a link to other site collections. I build up query taht loops through each item and call the listdata.svc SharePoint Service. For example one item has the url https://mysharepointurl the function will build

 

https://mysharepointurl/_vti_bin/Listdata.svc/MYSharePointlist (that list is on ever site collection with same name and id). The Resault will look like that 

 

TitleUrlColumn 1Column 2
Test 1hhttps://mysharepointurl1TestTest
Test 2https://mysharepointurl2TestTest

 

My Problem are currently the permission in sharepoint. Every user has read acces on the list that stores the url but not on the site collection. If the user is executing the query and has for one site collection no permissions, the query will break and ask for crendentials instead to load all the other columns where the user has enough permissions to acces the listdatasvc on the site collection.

 

Is there a possiblity to handle that so that Power Query is continuing with the query on the sites where the user has accees. Only workaorund i see is to give list item permissions. If the user do not see the entry in the list it works, but SharePoint and liste item permission are quiet complicated. 

 

I just need a solution if you get 401 skip that row show an error dosen't matter just continue with rest

 

Kind regards

Benjamin

1 REPLY 1
v-yuezhe-msft
Employee
Employee

Hi @benjamin183,

In Power Query, you can use try otherwise to ignore error 401 and continue to execute mashup differently, there is a similar thread for your reference: https://social.technet.microsoft.com/Forums/en-US/d0816891-6351-4d80-9fdc-1401e08a5f1d/how-to-ignore... .

However, I am afraid try otherwise doesn't help in your sceanrio. The problem is related to SharePoint permissions, there is not much we can do from Power Query side.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors