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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

Add Element to Sharepoint List from Custom Visual



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' 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 '' 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


Helpful resources

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.


Power BI Monthly Update - May 2024

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


Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors