0

I was wondering if there's any way to display data from outside salesforce in a Lightning Web Component. I tried putting a fetch call in the .js file of the component but it was blocked. Alternatively, would it work to make a JavaScript/React app that calls external data and nest it in a lightning web component?

  • normally, make a JavaScript/React app that calls external data and nest it in a lightning web component is not recommended, ideally, you would want to use lwc and slds and leverage SF's api's. as gNerb mentioned, you can easily fetch external content and display it in lwc. – glls Jul 4 at 1:38
0

My best guess as to why your call was blocked is that you did not whitelist the site you were trying to access.

This page describes how to perform callouts using fetch.

Alternatively, you can do the call out in the apex controller and return the results to the LWC.

Disclaimer

Due to the length of the article, I am not attempting to replicate it here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.