cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
CristinaD
Frequent Visitor

Add Element to Sharepoint List from Custom Visual

Hi,

 

I'm trying to create a custom visual that use the SpRestLib to add/edit/remove rows in a sharepoint list. I have written the javascript and imported the library and it seems that there are no errors in the code. 
When I run it to test it I recived an error of the networ saying: 
Access to XMLHttpRequest at https://app.powerbi.com/_api/contextinfo' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://teams.powerbi.com' that is not equal to the supplied origin.

I have tried to do it from a sharepoint aspx page and everything works fine there since it is on the same platform and I have no problem with CORS. I have always had a hard time understanding calls to apis, headers, security, etc. Can anyone help me to solve the issue?

Thanks in advance

0 REPLIES 0

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors