Combing Javascript fields

34 views
Skip to first unread message

Randy Flinn

unread,
Aug 26, 2025, 3:05:38 PMAug 26
to mementodatabase
I have two date fields 'Start Date' and 'End Date'.  I am using the following javascripts which formats as mm/dd/yyyy.

SDate (field) --> moment(field("Start Date")).format('L'); 
EDate (field) --> moment(field("End Date")).format('L');

How do I concatenate (or join) these  as the following example?

08/25/2025 - 08/26/2025

I have tried concatenate concat(field(SDate),field(EDate)) with no success.  Provides an error saying "Can't find variable: concat

Er Mo

unread,
Aug 26, 2025, 3:12:24 PMAug 26
to mementodatabase
Hallo
In einen Skript :
var sd = entry().field("Start Date")
var ed = entry().field("End Date")
var aus = sd +" - "+ed

aus = ist der Zusammengesetzte variable


Hello
In a script:
var sd = entry().field("Start Date")
var ed = entry().field("End Date")
var aus = sd +" - "+ed

aus = is the compound variable

Ernst

Randy Flinn

unread,
Aug 26, 2025, 3:32:50 PMAug 26
to Er Mo, mementodatabase
Hello,

I am still relatively new to this.  How do I then assign the compound variable to a field?


--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mementodatabase/24461a15-39d8-48bb-b4aa-01ffb08591f0n%40googlegroups.com.

Er Mo

unread,
Aug 26, 2025, 4:11:45 PMAug 26
to mementodatabase
Hallo

Du erstellst einen Trigger ( Automatisierung -->Skripte --> Plus zeichen unten -->Auslöser-->" Einen Eintrag erstellen / Vor den Speichern " . Hir schreibst du das Skript hinein . Die Ausgabe erfolgt in ein Feld ( Ich nenne es Ausgabe ) du musst den Namen in skript auf dein Feld nemen ändern .
Skript

Hello

You create a trigger (Automation --> Scripts --> plus sign below --> Trigger --> "Create an entry / Before saving". Enter the script here. The output is sent to a field (I'll call it Output). You need to change the name in script to match your field name.
Script
var e = entry()
var sd = e.field("Start Date")
var ed = e.field("End Date")

var aus = sd +" - "+ed
e.set("Ausgabe",aus)

Ernst
Reply all
Reply to author
Forward
0 new messages