Configure connection to external data in Sharepoint

%3CLINGO-SUB%20id%3D%22lingo-sub-1428842%22%20slang%3D%22en-US%22%3EConfigure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1428842%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHello!%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20want%20to%20create%20a%20list%20on%20my%20Sharepoint%20Online%20365%20by%20connecting%20to%20an%20API%20of%20a%20system%20where%20I%20will%20get%20all%20the%20registration%20information%20of%20my%20employees%2C%20then%20I%20will%20use%20this%20list%20as%20a%20data%20source%20in%20an%20application%20on%20PowerApps.%20How%20do%20I%20set%20up%20this%20connection%20to%20external%20data%20in%20Sharepoint%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1428842%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1429381%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1429381%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F684373%22%20target%3D%22_blank%22%3E%40leandrosg%3C%2FA%3E%26nbsp%3Byou%20would%20need%20to%20use%20Power%20Automate%20with%20a%20custom%20connection%20if%20there%20is%20no%20ready-built%20connector%20for%20the%20system%20that%20holds%20your%20registration%20information.%20That%20flow%20could%20get%20the%20registration%20data%20and%20populate%20the%20SharePoint%20list%20which%20could%20then%20be%20the%20data%20source%20for%20your%20app%20in%20Power%20Apps.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23333399%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1429423%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1429423%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F684373%22%20target%3D%22_blank%22%3E%40leandrosg%3C%2FA%3E%26nbsp%3BTo%20set%20up%20connection%20so%20that%20SharePoint%20data%20can%20be%20accessible%20from%20external%20connection%2C%20I%20have%20written%20a%20blog%2C%20please%20check%20below%20link%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.c-sharpcorner.com%2Fblogs%2Fsetting-for-sharepoint-online-to-accessible-from-external-environment%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.c-sharpcorner.com%2Fblogs%2Fsetting-for-sharepoint-online-to-accessible-from-external-environment%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1444433%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1444433%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F679665%22%20target%3D%22_blank%22%3E%40Ashish_Kohale%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3EFirst%20of%20all%20congratulations%20on%20the%20blog%2C%20but%20I%20couldn't%20get%20past%20the%20xml%20permission%20part%0A%0AFailing%20to%20create.%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22leandrosg_0-1591408579336.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196864iE06C262FE3528DA1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22leandrosg_0-1591408579336.png%22%20alt%3D%22leandrosg_0-1591408579336.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1445214%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1445214%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F684373%22%20target%3D%22_blank%22%3E%40leandrosg%3C%2FA%3E%26nbsp%3B%3A%20It%20seems%20you%20need%20tenant%20level%20permission%20to%20trust%20this%20app.%20This%26nbsp%3Bgranting%20can%20only%20be%20done%20via%20the%20appinv.aspx%20page%20on%20the%20tenant%20administration%20site.%26nbsp%3B%3CSPAN%3EYou%20can%20reach%20this%20site%20via%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftenantname-admin.sharepoint.com%2F_layouts%2Fappinv.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2FtenantName-admin.sharepoint.com%2F_layouts%2Fappinv.aspx%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%3E.%20Once%20the%20page%20is%20loaded%20add%20your%20client%20id%20and%20look%20up%20the%20created%20principal.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EUse%20below%20XML%20to%20get%20the%20full%20control%20permission%20for%20the%20APP.%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CSPAN%20class%3D%22hljs-tag%22%3E%26lt%3B%3CSPAN%20class%3D%22hljs-name%22%3EAppPermissionRequests%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3EAllowAppOnlyPolicy%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22true%22%3C%2FSPAN%3E%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-tag%22%3E%26lt%3B%3CSPAN%20class%3D%22hljs-name%22%3EAppPermissionRequest%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3EScope%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22http%3A%2F%2Fsharepoint%2Fcontent%2Ftenant%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3ERight%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22FullControl%22%3C%2FSPAN%3E%20%2F%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-tag%22%3EAppPermissionRequests%3C%2FSPAN%3E%26gt%3B%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%3CAPPPERMISSIONREQUESTS%20allowapponlypolicy%3D%22%26quot%3Btrue%26quot%3B%22%3E%20%3CAPPPERMISSIONREQUEST%20scope%3D%22%26quot%3Bhttp%3A%2F%2Fsharepoint%2Fcontent%2Ftenant%26quot%3B%22%20right%3D%22%26quot%3BFullControl%26quot%3B%22%3E%3C%2FAPPPERMISSIONREQUEST%3E%20%3C%2FAPPPERMISSIONREQUESTS%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22hljs-tag%22%3EWhen%20you%20click%20on%20Create%20you'll%20be%20presented%20with%20a%20permission%20consent%20dialog.%20Press%20Trust%20It%20to%20grant%20the%20permissions%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1445683%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1445683%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F679665%22%20target%3D%22_blank%22%3E%40Ashish_Kohale%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20all%20the%20steps%2C%20but%20it%20didn't%20work.%3CBR%20%2F%3EWhen%20I%20am%20going%20to%20generate%20the%20Sharepoint%20api%20website%20it%20presents%20the%20following%20error%3A%3CBR%20%2F%3E%22error_description%22%3A%20%22Exception%20of%20type%20'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException'%20was%20thrown.%22%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22print_error.PNG%22%20style%3D%22width%3A%20910px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197041i3FF4C051AA379E5E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22print_error.PNG%22%20alt%3D%22print_error.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1445924%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1445924%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F684373%22%20target%3D%22_blank%22%3E%40leandrosg%3C%2FA%3E%26nbsp%3B%3A%20Check%20the%20API%2C%20it%20should%20be%20this%20format%3A%26nbsp%3B%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2F%3CSITENAME%3E.sharepoint.com%2F_api%2Fweb%3F%24select%3DTitle%3C%2FSITENAME%3E%3C%2FA%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EYou%20have%20used%20%3CSTRONG%3E_layout%2F15%2F%3C%2FSTRONG%3E%2C%20should%20not%20be%20part%20of%20API%20URL.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1449745%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1449745%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F679665%22%20target%3D%22_blank%22%3E%40Ashish_Kohale%3C%2FA%3E%26nbsp%3B%26nbsp%3B%3CSPAN%3EI%20put%20the%20url%20as%20your%20indication%20and%20the%20error%20continues.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PrintError2.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197427iE014792BC95C94A5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22PrintError2.PNG%22%20alt%3D%22PrintError2.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1450494%22%20slang%3D%22en-US%22%3ERe%3A%20Configure%20connection%20to%20external%20data%20in%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1450494%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F684373%22%20target%3D%22_blank%22%3E%40leandrosg%3C%2FA%3E%26nbsp%3B%3A%20Hope%20you%20are%20changing%20the%20authorization%20token%20after%20token_type%20%22Bearer%22%20which%20generated%20from%20below%20API%3A%3C%2FP%3E%3CP%3E%3CA%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehttps%3A%2F%2Faccounts.accesscontrol.windows.net%2F%3CTENANTID%3E%2Ftokens%2FOAuth%2F2%3C%2FTENANTID%3E%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello!

I want to create a list on my Sharepoint Online 365 by connecting to an API of a system where I will get all the registration information of my employees, then I will use this list as a data source in an application on PowerApps. How do I set up this connection to external data in Sharepoint?

8 Replies
Highlighted

@leandrosg you would need to use Power Automate with a custom connection if there is no ready-built connector for the system that holds your registration information. That flow could get the registration data and populate the SharePoint list which could then be the data source for your app in Power Apps. 

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Highlighted

@leandrosg To set up connection so that SharePoint data can be accessible from external connection, I have written a blog, please check below link:

https://www.c-sharpcorner.com/blogs/setting-for-sharepoint-online-to-accessible-from-external-enviro...

 

 

Highlighted

@Ashish_Kohale 

First of all congratulations on the blog, but I couldn't get past the xml permission part

Failing to create.

 

leandrosg_0-1591408579336.png

 

Highlighted

@leandrosg : It seems you need tenant level permission to trust this app. This granting can only be done via the appinv.aspx page on the tenant administration site. You can reach this site via https://tenantName-admin.sharepoint.com/_layouts/appinv.aspx. Once the page is loaded add your client id and look up the created principal.

 

Use below XML to get the full control permission for the APP.

Spoiler
<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" /> </AppPermissionRequests>

 

When you click on Create you'll be presented with a permission consent dialog. Press Trust It to grant the permissions

 

 

Highlighted

@Ashish_Kohale 

I did all the steps, but it didn't work.
When I am going to generate the Sharepoint api website it presents the following error:
"error_description": "Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."

print_error.PNG

 

Highlighted

@leandrosg : Check the API, it should be this format: https://<sitename>.sharepoint.com/_api/web?$select=Title

 

You have used _layout/15/, should not be part of API URL.

 

Highlighted

@Ashish_Kohale  I put the url as your indication and the error continues.

 

PrintError2.PNG

Highlighted

@leandrosg : Hope you are changing the authorization token after token_type "Bearer" which generated from below API:

https://accounts.accesscontrol.windows.net/<TenantID>/tokens/OAuth/2