From 4435fb0d7ef9ac12f73da3ad5d9464f0b7370021 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Fri, 20 Jan 2023 08:16:05 +0100 Subject: [PATCH] :pencil: Add extract first name example --- apps/docs/docs/editor/blocks/logic/set-variable.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/docs/docs/editor/blocks/logic/set-variable.md b/apps/docs/docs/editor/blocks/logic/set-variable.md index 57f3b31f0..195662148 100644 --- a/apps/docs/docs/editor/blocks/logic/set-variable.md +++ b/apps/docs/docs/editor/blocks/logic/set-variable.md @@ -38,6 +38,12 @@ Compute a percentage: {{Score}} * 100 / {{Max Score}} ``` +Extract the first name from a full name: + +``` +{{Full name}}.split(' ')[0] +``` + ## Code The code value should be written Javascript. It will read the returned value of the code and set it to your variable.