Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors