Commit 3a86b94
M10.12: fix full_name CEL formula leading-space bug
When salutation is null (the common case for non-formal contacts),
the old expression produced ' Alice Martinez' with a leading space
because coalesce(record.salutation, '') + ' ' + … always glued an
empty string + space.
Add two helpers to the formula stdlib:
- trim(dyn): string — null-safe trim, returns '' for nullish
- joinNonEmpty(list, string): string — drops null/undefined/empty
entries (after trimming) before joining; ideal for display-name
formulas
Rewrite lead.full_name and contact.full_name to use
joinNonEmpty([record.salutation, record.first_name, record.last_name], ' ')
so output is exactly 'Alice Martinez' with no leading/trailing/internal
extra spaces regardless of which name parts are null.
Verified via GET /api/v1/data/lead?limit=2 — first row returns
full_name="Alice Martinez" with salutation=null. Previously this
was " Alice Martinez".
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4135b51 commit 3a86b94
3 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
76 | 104 | | |
77 | 105 | | |
78 | 106 | | |
| |||
0 commit comments