Nintex for SharePoint Forum
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
How can we use SharePoint Online context in a Nintex Form?
This code not working and return a undefined for _spPageContextInfo, so what Nintex Form use to commit form fields to sharepoint list and keep users informations alive in the nintex form?
var pollSP;
NWF.FormFiller.Events.RegisterAfterReady(function () { console.log("*** NintexForms.js RegisterAfterReady: " + BusinessUnitClientID); pollSP = setInterval(checkSPLoad, 500); try { if (ExpirationDateClientID != "") { SetDefaultExpirationDate(); AttachEventOnChangeInput("input[id='" + ExpirationDateClientID + "']", "SetDefaultExpirationDate();"); if (CollaborationTypeClientID != "") { AttachEventOnChangeInput("select[id='" + CollaborationTypeClientID + "']", "SetDefaultExpirationDate();"); } } } catch (err) { console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); console.log(err); console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } }); function checkSPLoad() { if (clientContext) { window.clearInterval(pollSP); onSPLoad(); } } function onSPLoad() { try { console.log("*** onSPLoad called "); var userId = _spPageContextInfo.userId; console.log("*** onSPLoad Current User = " + userId); } catch (err) { console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); console.log(err); console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } }
To all technicals nintex evangelists, If it's not possible, doe not hesitate and please confirm it to me, so i can stop losing my times with nintex form and do it easiest with an SPFx components.
cheers!
@maxime_ouellet, Can you share what you are trying to do with SharePoint Online Context?
Wihtin Nintex forms you can use calculated value controls and labels to show information from the context of the form such as initiator, current date, time, etc. You can also pull information from the User Profile as well.
As @eharris04 mentioned, the userprofile function can pull data back from the user profile service for the logged in user. This example below is pulling back the preferred language property as an example.
I'll try it with current user login id, previously i used Email and it's unfortunately always return "ui-ui" as a value
@eharris04 , i just want to do everything that i can do with an spfx form, like complex ajax call on list /or search result, multiples updates in multiple list with complex criteria rules... i just want to make nintex more powerfull with my client needs 🙂
@EuanGamble , it's only return ui-ui as a value.
<div style="top:35px;left:235px;z-index:100;overflow:hidden;background-color:;height:25px;width:165px;" class="nf-form-hidden nf-filler-control nf-filler-highlightonvalidationerror" formcontrolid="c7af2b34-318b-4d2a-be6b-2946f0a93f05" data-controlname="__UserLanguage" data-uniqueid="c0a89c70-0781-4bd4-8623-f73675005e17" data-controlid="c7af2b34-318b-4d2a-be6b-2946f0a93f05" data-formcontroltypeid="c0a89c70-0781-4bd4-8623-f73675005e17" data-enabled="True"><div class="nf-filler-control-border"><div class="nf-filler-control-inner"><div style="overflow:hidden;width:100%;" class="nf-calculation"><label class="nf-calculation-control" style="vertical-align:inherit;">ui-ui</label><input name="ListForm$formFiller$FormView$ctl102$ctl20$d2ef08eb_5286_40ac_8562_50b2f0672d7c" type="hidden" id="ListForm_formFiller_FormView_ctl102_ctl20_d2ef08eb_5286_40ac_8562_50b2f0672d7c" class="nf-calculation-control-value" data-type="string2" formcontrolid="c7af2b34-318b-4d2a-be6b-2946f0a93f05" value="ui-ui"></div></div></div></div>
Hi @maxime_ouellet,
I have tested it on my 365 environment successfully. Are you sure you have your language set in editprofile.aspx
@EuanGamble , can you try the same in a classic form? I must use classic to do some complex validation and default selection that isn't exist in modern ui ....