Lightning Forms – Template vs Assignment vs Function Code

Within the expression builder of Lightning Forms, you’ll find 3 different options for creating an expression. In this video, we explore the differences between Template, Assignment and Function Code.

The example Javascript used in Function Code is below:

if ([[FirstName]] !== “” && [[Title]] !== “”)
return [[FirstName]]+” “+[[Title]];
else return null;

An example of using function code for date manipulation can be found below:

 if ([[ContractType]] == “Monthly”) 
  return [[StartDate]].addMonths(1);
 else if ([[ContractType]] == “Quarterly”) 
  return [[StartDate]].addMonths(3);
 else if ([[ContractType]] == “Semi-Annually”) 
  return [[StartDate]].addMonths(6);
 else if ([[ContractType]] == “Annually”) 
  return [[StartDate]].addYears(1);
 else return null;

Related Posts
Clear Filters

Brett Lonsdale (Co-Founder and CEO of Lightning Tools) and Rob D’Oria (Co-Founder and CTO of Kudzu Software) demonstrate the Kudzu…

In this article we look at how legacy InfoPath Forms can be migrated into Modern SharePoint by using Kudzu Software and Lightning Forms.

Add Comment