Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Launching SharePoint Apps with/from an PCF Component

(0) ShareShare
ReportReport
Posted on by 21

Hey all! 

 

Sorry if this question is a simple one, I am just getting into PCF Components...

My Goal is to develop a PCF Component (model or canvas app doesnt matter) for dynamics 365, with the aim to create/edit sharepoint files and save it in dynamics 365.

I have seen ways to get existing data via the SharePoint API, however, I am not sure if its possible to call the SharePoint API from a PCF Component.

 

My main Question would be: 

Is it possible to launch the online version of Excel, Word,... from or within a PCF Component? 

 

Thank you and best regards

 

  • Verified answer
    cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Launching SharePoint Apps with/from an PCF Component

    There are actually two SharePoint APIs: the REST API and the CSOM API. CSOM is older but has widespread adoption among SharePoint developers, so it might be easier to find team members who are familiar with it.

     

    There are a couple example PCFs on the PCF Gallery that work with SharePoint content; not sure whether they are actually using the REST API but it is worth taking a look at their code.

     

    Generally, when you go to implement API calls in a PCF your biggest issue is going to be authentication. You will need to secure the currently logged in user's credentials securely then pass those on to the API you are calling. As I mentioned in the previous reply the normal mechanism for this is to register an App with AD, give it Delegate permissions to SharePoint (or whatever app), then use MSAL in your app to retrieve the user token and pass it in your API call.

     

    The only realistic alternative to this is to offload the calls to some server-executing component where the code cannot be interrupted by a malicious user to inspect the authentication. From that externally executing context you can use any credentials you want, including an app id that has app permissions instead of delegate ones.

  • TheTruePowerDev Profile Picture
    21 on at
    Re: Launching SharePoint Apps with/from an PCF Component

    Hello!

    I would actually prefer to call the SharePoint API instead of opening SharePoint in an iFrame.
    Is there any Sample I could follow in order to incorporate SharePoint with PCF?
    I have found out, that there is a SharePoint-REST-Service , is this the API you mentioned?
    Are there any restrictions, that would limit me from calling the mentioned REST-Service  from a PCF-Control in Dynamics 365 online? It just wasnt sure, since I couldnt find any sample that incorporates the SharePoint API with a PCF-Control and since I also found a forum entry in which it was stated that its not possible for PowerApps Portals.

    Thanks for your reply! 🙂

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Launching SharePoint Apps with/from an PCF Component

    Well, you can effectively have your PCF just be an IFrame. In fact, this is one of the example PCFs published by Microsoft. That IFrame in turn can render any page, including a SharePoint App, which lets you run straight past authentication mechanisms and API call complexities.

     

    Alternatively. you can make the API calls directly from your PCF to SharePoint (bypassing the SharePoint App entirely). To do this, though, you will need to handle your own authentication for the calls, so you will probably want an App Registration with Delegate permissions to SharePoint, then use MSAL to retrieve the currently logged in user's token and pass it through. You could also offload the calls to a server-side component, like a Function, but to me this seems like an unnecessary number of hops.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 69 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 51 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 36

Overall leaderboard