In this post, we will discuss how we can set a default value for lookup columns in Nintex forms for Office 365 SharePoint online. Here in this particular example, I have a SharePoint Online list which has two columns and I am displaying the values in another SharePoint list form. If you are new to Nintex forms, check out Working with Nintex Forms for Office 365 SharePoint Online.
Open the SharePoint Online list where you want to add the lookup columns. From the ribbon, click on Nintex forms which will open the Nintex forms designer.
Now if you will look at the preview you can see all the fields are coming like below:
But here my requirement is to set a default value for it. After Google, I got the easiest solution from here.
We can achieve this thing by writing a few lines of JavaScript code.
First, double-click on the control and then expand the Advanced tab and there select Yes for “Store Client ID in JavaScript variable”. And then give a variable name like below: (Here I have given ddlstateID)
Then from the Ribbon (Designer Tab), click on Form Settings. Then expand the Custom JavaScript tab and put the below code.
NWF.FormFiller.Events.RegisterAfterReady(function () {
NWF$(‘#’ + ddlstateID).on(‘change’, function (e) {
if (e.originalEvent == undefined) {
if (this.value == “”) {
this.value = “3”;
}
}
});
});
Here we need to see this.value = “3”;
Here 3 is the item id in the source list which I want to set the default value.
Then Save the form as it will appear like below:
You may like following Nintex forms for Office 365 tutorials:
- Steps to create column in Nintex forms designer in Office 365 SharePoint Online
- How to use Repeating Section in Nintex forms for Office 365 SharePoint online?
- How to change Nintex Forms header banner in SharePoint Online Office 365?
- How to apply rules in Nintex forms for Office 365 SharePoint online?
- How to reset to out of box list forms from Nintex Forms customization in SharePoint Online
- How to use set field value in Nintex Forms for Office 365 in SharePoint Online using JavaScript?
- How to use JavaScript in Nintex forms for Office 365?
- How to implement mandatory field validation in Nintex forms in Nintex forms for Office 365 SharePoint Online?
- Steps to show cascading dropdown in Nintex Forms for Office 365 SharePoint Online
- How to implement validation rules by condition in Nintex forms for Office 365 SharePoint Online?
- Add different layouts into Nintex forms in Office 365 SharePoint Online
- How to design multiple step forms using Nintex forms for Office 365 SharePoint Online?
Hope this Nintex Forms for Office 365 tutorial will be helpful to you to set a default value in lookup column Nintex forms for Office 365 SharePoint Online.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com