Skip to main content

Notifications

Community site session details

Community site session details

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

Same PCF control for portal, canvas app and model driven app

(0) ShareShare
ReportReport
Posted on by

I am building a PCF control targeting to portal, canvas app and model driven app.

 

One challenge I am facing with API call.

 

For portal app, I need to call custom api which will not work in canvas app I think. 

 

So my question is how my PCF control will identity in which environment the control is running like in portal app or canvas app or model driven app so that I can call different API according to the platform identification?

  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: Same PCF control for portal, canvas app and model driven app

    Hi @Anonymous , 

     

    To detect where the PCF is running, I have an idea posted, maybe you want to vote it: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Runtime-possibility-to-detect-if-the-PCF-is-running-in/idi-p/500232

     

    Until not long ago, was not not possible to detect this, since the framework would show a message, if you call a context.webAPI function. But lately the error message is not shown anymore, so you can try with a "catch", and if it doesn't work, can go with the next way. That's actually what the SDK now says: https://docs.microsoft.com/en-us/powerapps/developer/component-framework/code-components-best-practices?WT.mc_id=BA-MVP-5004107#check-api-availability

     

    Hope this helps!

     

    Kind regards,

    Diana

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 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…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard