web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / REST API not supported
Power Apps
Unanswered

REST API not supported

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am exploring creating PCF controls. One requirement is to connect to data sources outside of Dynamics/CDS. Is this capability supported by the framework? Will I need to handle my own authentication flow through adal.js accordingly?

I have the same question (0)
  • Ben Thompson Profile Picture
    1,400 on at

    You can call external rest api's (provided of cause you avoid any CORS related issue) and we discussed connecting to Nasa photo a day api the week before last (when I get a spare hour I will create a component that does just that and publish it on Github.

     

    Unfortunately you will need to handle any authentication flow yourself and you really need a typescript library to do that (look at adal-ts for a typescript ADAL library). 

     

     

  • indikaa Profile Picture
    31 on at

    Hi @davallen , 

    We have used "cross-fetch" to do the api call.

     

    add cross-fetch

    npm install cross-fetch

    sample code

    private async makeRequest() {
    let searchName = this._searchNameElement.value;
    console.log(searchName);

    fetch('https://api.github.com/users/' + searchName , {
    method: "GET"
    })
    .then(res => {
    if (res.status >= 400) {
    throw new Error("Bad response from server");
    }
    return res.json();
    })
    .then(data => {
    console.log("Data");
    console.log(data);
    let resp = JSON.stringify(data, null, '');
    let j = JSON.parse(resp);
    this._fullNamelableElement.innerHTML = j['name'];
    })
    .catch(err => {
    console.error(err);
    });
    }

     

     

     

     

  • indikaa Profile Picture
    31 on at

    Hi @BenJBauer , 

    Interesting to know when we use PCF components to call an api what would be the source of the request. We also had some issue with CORS. It worked when we use a wildcard.  

  • hansgfixed Profile Picture
    37 on at

    @davallen wrote:

    I am exploring creating PCF controls. One requirement is to connect to data sources outside of Dynamics/CDS. Is this capability supported by the framework? Will I need to handle my own authentication flow through adal.js accordingly?


    I used node-rest-client and it worked like a charm.

  • Hemant Gaur Profile Picture
    on at
    We do not support the external data sources 1st class like canvas powerApps. You can evaluate embedded canvas app for data fetch scenarios or use the auth library. Please consider token handling , mobile shims especially don't have a way to handle these. Server side plugin and azure keyvalult are other potential options.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 372 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 303 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 238 Super User 2026 Season 1

Last 30 days Overall leaderboard