Skip to main content
Nintex Community Menu Bar

Ajax errors in Nintex Forms O365

  • April 26, 2021
  • 1 reply
  • 116 views
  • Translate

Hi,

 

I am new to Nintex forms O365 classic designer. Actually we are doing migration from SharePoint on premise to Online.

In our On-Prem, we are have custom forms and developed using JavaScript. So when I am trying to use the ajax calls code in Online they are throwing error.

Like for "_spPageContextInfo.webAbsoluteUrl" is throwing error "Uncaught TypeError: Cannot read property 'webAbsoluteUrl' of undefined"
I tried hard coded with my online site in place of weburl, but it is throwing error,  forbidden 403 error at ajax url.

 

So, I followed the solution in the blow forum
https://community.nintex.com/t5/Nintex-for-Office-365-Forum/How-do-I-call-SharePoint-2013-Rest-APIs-from-Nintex-Form/td-p/35104

Here the solution is having success and error methods, but I need the latest methods done and fail.

 

So can you please help me to how to use my existing code ajax call with done and fail methods. Do I need to use any reference jQuery files in order to use my old On-Prem JavaScript code.

 

Thanks,
Kishore.

Did this topic help you find an answer to your question?

1 reply

nico
Forum|alt.badge.img+10
  • Rookie
  • 152 replies
  • April 30, 2021

Hi,

You are on an SharePoint App, and so, you are not directly in your SharePoint site (nintex is a Hosted App), So the JavaScript Object _spPageContextInfo don't exist on your classic form.

For your error forbidden 403 error, you don't have the formDigest on your page, so when you will send your REST query, you will not have your authentication token (formDigest), that why you have an 403 error.

 

The Jquery is already embeed in the Nintex classic form, it's just renamed by : NWF$

 

To make query to you SharePoint site I recommand to use the SP.RequestExecutor like the exemple, you will need to re-write some part of your code 😉

 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings