Is it possible to split the Name in the Name field into First Name, Last Name? If not I will add two extra Custom Fields.
If I do that are there any ramifications in having the Name field blank (or even deleting the Name field altogether)?
Is it possible to split the Name in the Name field into First Name, Last Name? If not I will add two extra Custom Fields.
If I do that are there any ramifications in having the Name field blank (or even deleting the Name field altogether)?
Where do you need to use the split values?
A quick script could seperate on first space or other pattern.
I want to use the first name for kitchen/coffee order tickets. We have a lot of regular customers so when they ātagā in their name will show on the ticket.
At first create script.
function split(name) {
var str = name;
var res = str.split(" ");
return res[0]
}
Then paste code below to ticket template where you want.
{CALL:splitd.split(ā{ENTITY NAME}ā)}
If your customer name is āsalim arda koseā. will write only āsalimā
if you want to write āArdaā use this script
function split(name) {
var str = name;
var res = str.split(" ");
return res[1]
}
or for write ākƶseā use this
function split(name) {
var str = name;
var res = str.split(" ");
return res[2]
}
only change 0,1,2, ā¦
.
Awesome, thanks for that, Iāll test it out tomorrow.
Cheers
[='{ENTITY NAME}'.replace(/ (.*)/g,"")]
That is more easy. Great.
ilyas YILDIZHAN
[='{ENTITY NAME}'.replace(/ (.*)/g,"")] ilyas
[='{ENTITY NAME}'.replace(/(.*) /g,"")] YILDIZHAN
[='{ENTITY NAME}'.replace(/ (.*)/g,"")] [='{ENTITY NAME}'.replace(/(.*) /g,"")] ilyas YILDIZHAN
Thanks Ilyas, that worked a treat!
I had to use this though:
[='{ENTITY NAME:Customers}'.replace(/ (.*)/g,"")]