Placeholder Templates

Explore a variety of customizable placeholder templates to enhance your form designs.


=== === === === === === === === ===

 Date Placeholders & Functions

=== === === === === === === === ===



Set to Today's Date @ 6:30 am (Initial):

var today = new Date();
return new Date(today.getFullYear(), today.getMonth(), today.getDate(), 6, 30);


Set today's date, in MM/dd/yyyy format: (3 methods)
 

{ var today = new Date();return new Date(today.getFullYear(), today.getMonth(), today.getDate()).format("MM/dd/yyyy"); }

//OR....

=new Date().format("MM/dd/yyyy")

//OR...

[[DateField]].format("MM/dd/yyy")


Today's date + 2 days:
 

= new Date().addDays(2).format("MM/dd/yyyy");

 

Formatting the Date into different styles:
 

[[=new Date().format("MM/dd/yyyy h:mm tt")]]
Return: 10/11/2023 9:51 AM
-
[[=new Date().format("MMMM dd")]]
Return:October 11
-
[[=new Date().format("hh:mm tt")]]
Return: 09:53 AM
-
[[=new Date().format("h:mm tt")]]
Return: 9:53 AM
-
[[=new Date().format("yyyy MMMM")]]
Return: 2023 October

 

More Date Placeholders & Functions to format date & time values:

[[=[[YourDateField]].localeFormat('dd.MM.yyyy, HH.mm')]]
Return: "15.02.2024, 09.30"
[[=[[YourDateField]].toLocaleString('de-CH',{hour24: false})]]
Return: "15.2.2024, 09:30:00"

 

When using new Date() in Things in background e.g. in Add list item as Triggered Action, you'll recognize the date & time is from server: UTC time (time zone)

Use the following function to convert date & time into SharePoint site's local time (Time zone from site's Regional Settings)

=[[@Functions.UTCToLocalTime(new Date())]]
Returns current date & time of SharePoint site's time zone. e.g. UTC+2: 2024-03-19T14:13:02.538Z


If you want to use it as formatted text output, nest the functions like this:

[[=[[@Functions.UTCToLocalTime(new Date())]].format("dd.MM.yyyy HH:mm")]]
Return: "15.02.2024 09.30" (time of SP sites time zone e.g. UTC+2)

 

=== === === === === === === === ===

Others

=== === === === === === === === ===


EvaluateExpression and GetFirstValueForQuery function

Use case: Manage Texts with placeholders for outgoing emails in lists instead hardcoded in action configuration (load text and replace placeholders): 

[[@Functions.EvaluateExpression([[@Web.GetFirstValueForQuery('[[@Web.ServerRelativeUrl]]/Lists/EmailTextVorlagen', '<Where><Eq><FieldRef Name="Case" /><Value Type="Text">Sitzung abgeschlossen</Value></Eq></Where>', 'Subject')]])]]

 

Format numbers with leading zeros. E.g. Project numbers like PR00034

var nextProjectNr = (1 + Number([[@Functions.GetFirstValueForQuery('Lists/Projects', '<View Scope="Recursive"><Query><OrderBy><FieldRef Name="ProjectNrINT" Ascending="FALSE" /></OrderBy></Query></View>', 'ProjectNrINT')]]));
var leadingZeroNumber = "00000" + nextProjectNr;
nextProjectNr = leadingZeroNumber.substr(leadingZeroNumber.length - 5);
return nextProjectNr;

 It works well, but there is a more straightforward way with padStart() js function:

var nextProjectNr = (1 + Number([[@Functions.GetFirstValueForQuery('Lists/Projects', '<View Scope="Recursive"><Query><OrderBy><FieldRef Name="ProjectNrINT" Ascending="FALSE" /></OrderBy></Query></View>', 'ProjectNrINT')]]));
nextProjectNr = nextProjectNr.toString().padStart(5, "0");
return nextProjectNr;

Notice: The number needs to be a string when using padStart()

 

Image Columns

'{"type":"thumbnail","fileName":"[[ImageColumn.FileName]]","serverRelativeUrl":"[[ImageColumn.URL]]"}'

 

Using Length Function

=[[@SelectedItems]].length > 0

//OR

=[[@Web.QueryList('Delivery Log', '<View><Query><Where><Eq><FieldRef Name="DailyFieldReportID" /><Value Type="Text" ProviderType="FormInput">[[ID]]</Value></Eq></Where></Query></View>')]].length

 

Checking for Null (Used in 'Visible' Expression. This example Hides 'ProgressImage6', unless a picture exists.]

=[[ProgressImage6]] !== null

 

Window Variables

window.dataLookups = {
   "ProjectName": [[BidIDSearch.ProjectName]],
  "OpportunityName": [[OpportunityName]],
   "ProcurementID": [[ID]],
   "BidID": [[BidIDSearch.Bid_x002d_ID]]
}

----

[[=window.dataLookups.ProjectName]]
[[=window.dataLookups.OpportunityName]]
[[=window.dataLookups.ProcurementID]]
[[=window.dataLookups.BidID]]

Was this article helpful?

Can’t find what you’re looking for?

Our world-class Customer Success team is here for you.

Contact Support