clean-holiday-47965
01/16/2024, 3:40 PMNamesTable
.clean-holiday-47965
01/16/2024, 3:41 PMclean-holiday-47965
01/16/2024, 3:41 PMclean-holiday-47965
01/16/2024, 3:41 PMclean-holiday-47965
01/16/2024, 3:43 PMQuestion to ask the user
with your preferred text and then create a variable (name whatever you like, we named it name
) to store the result.clean-holiday-47965
01/16/2024, 3:45 PMworkflow.firstLetterCapital = workflow.name.charAt(0).toUpperCase() + workflow.name.slice(1);
[ ? ] What it does? It capitalizes the first letter of the workflow's name variable (as we named our variable name).
Moving to the next, open Find Records and select the Table, enter the value into Records Filter
similar to this (depends on that variable u have set) :
Name is either @workflow.name or @workflow.firstLetterCapital
And **Result Variable : **create a variable and name it (we named ours userRow
)clean-holiday-47965
01/16/2024, 3:49 PM[previous steps result variable].length greater than zero
Note: change [previous steps result variable]
*with yours.
i.e ours was* workflow.userRow
so the code was
workflow.userRow.length greater than zero
It will execute as similar to this workflow.userRow.length > 0
Its done. Moving to the last part of this node, theres a slight changes here.
Input in Label:
[previous steps result variable].length is zero
Will look in Condition as:
workflow.userRow.length === 0
Now that you know how it works, lets do the remaining tasks a little faster.
Create another node and add
- Execute Code (one)
- Code to enter:
const firstName = workflow.name
const records = workflow.userRow
console.log("RECORDS: " + JSON.stringify(records))
workflow.record = records[0].id
Close.
- Open Phone Number (Capture Information) and Question to ask the user
with whatever you like and then create a variable (we named ours `phone`—example shown below)clean-holiday-47965
01/16/2024, 3:50 PM@workflow.record
(put this code as it was coded into the Execute Code earlier)
- Phone: @workflow.phone
Now, everything will look similar to this.clean-holiday-47965
01/16/2024, 3:51 PMemail
).clean-holiday-47965
01/16/2024, 3:53 PM@workflow.record
) and Email: @workflow.email
Part 2: Can call it as new data entry.
Create a node >
- phone : store result in > workflow.phone
(same variable that was used before)
- Insert Record : select the same table > Name: @workflow.name
(no change required)
- Phone: @worfkflow.phone
- Email: Leave the email empty right now.clean-holiday-47965
01/16/2024, 3:56 PMName equals @workflow.name
(same)
* Result Variable: * workflow.userRow
(same)
Execute Code : (same as before in Part 1, you can just copy and paste from previous)
const firstName = workflow.name
const records = workflow.userRow
console.log("RECORDS: " + JSON.stringify(records))
workflow.record = records[0].id
Email: copy and paste from the previous email card
Update Record: copy and paste from the Update Record card.
---------------------------------------------------------------------------------------------------------
Optional: You can create another node with texts lie Thank you for your info…blab la bla..Its upto you.
================================= Build Done ===========================================
Time to test the bot. Here’s ours:
Chat:clean-holiday-47965
01/16/2024, 3:56 PMclean-holiday-47965
01/16/2024, 3:56 PMclean-holiday-47965
01/16/2024, 3:56 PMquick-musician-29561
01/16/2024, 4:01 PMquick-musician-29561
01/16/2024, 4:06 PMclean-holiday-47965
01/16/2024, 4:07 PMquick-musician-29561
01/16/2024, 4:09 PMcrooked-van-25152
01/16/2024, 6:00 PMclean-holiday-47965
01/16/2024, 6:12 PMcrooked-van-25152
01/16/2024, 6:27 PMgray-activity-74012
01/17/2024, 2:07 AMclean-holiday-47965
01/17/2024, 5:56 AMclean-holiday-47965
01/17/2024, 9:11 AMclean-holiday-47965
01/17/2024, 9:12 AMjolly-policeman-82775
01/17/2024, 11:41 AMclean-holiday-47965
01/17/2024, 12:27 PMjolly-policeman-82775
01/17/2024, 12:49 PMcrooked-ram-87124
01/17/2024, 1:29 PMjolly-policeman-82775
01/17/2024, 1:35 PMclean-holiday-47965
01/17/2024, 1:43 PMjolly-policeman-82775
01/17/2024, 1:44 PMjolly-policeman-82775
01/17/2024, 1:44 PMjolly-policeman-82775
01/17/2024, 1:44 PMjolly-policeman-82775
01/17/2024, 1:44 PMjolly-policeman-82775
01/17/2024, 1:44 PMclean-holiday-47965
01/17/2024, 1:44 PMjolly-policeman-82775
01/17/2024, 1:44 PMclean-holiday-47965
01/17/2024, 1:46 PMclean-holiday-47965
01/17/2024, 1:47 PMjolly-policeman-82775
01/18/2024, 2:30 AMjolly-policeman-82775
01/18/2024, 2:30 AMfresh-fireman-491
01/19/2024, 10:24 AMclean-holiday-47965
01/19/2024, 12:49 PM....length grater than zero
fresh-fireman-491
01/19/2024, 1:19 PMclean-holiday-47965
01/19/2024, 3:39 PMable-rocket-15603
01/23/2024, 12:13 AMclean-holiday-47965
01/31/2024, 6:03 PMbusy-cricket-64025
02/16/2024, 9:36 AMclean-holiday-47965
02/17/2024, 10:18 AMbusy-cricket-64025
02/18/2024, 7:38 PMclean-holiday-47965
02/22/2024, 4:48 PMthousands-raincoat-37715
03/03/2024, 9:40 AMthousands-raincoat-37715
03/03/2024, 9:41 AMclean-holiday-47965
03/04/2024, 8:24 PMthousands-raincoat-37715
03/04/2024, 8:25 PMthousands-raincoat-37715
03/04/2024, 8:25 PMthousands-raincoat-37715
03/04/2024, 8:25 PMthousands-raincoat-37715
03/04/2024, 8:25 PMclean-holiday-47965
03/04/2024, 8:26 PMthousands-raincoat-37715
03/04/2024, 8:27 PMthousands-raincoat-37715
03/04/2024, 8:27 PMthousands-raincoat-37715
03/04/2024, 8:27 PMclean-holiday-47965
03/04/2024, 8:28 PMthousands-raincoat-37715
03/04/2024, 8:32 PMthousands-raincoat-37715
03/04/2024, 8:32 PMthousands-raincoat-37715
03/04/2024, 8:32 PMclean-holiday-47965
03/04/2024, 9:05 PMthousands-raincoat-37715
03/05/2024, 5:31 PMthousands-raincoat-37715
03/05/2024, 5:32 PMthousands-raincoat-37715
03/05/2024, 5:32 PMclean-holiday-47965
03/06/2024, 5:14 PMthousands-raincoat-37715
03/06/2024, 7:00 PMbroad-postman-77251
04/28/2024, 1:17 PMclean-holiday-47965
05/14/2024, 4:09 PMclever-exabyte-40857
11/22/2024, 3:31 PMclever-exabyte-40857
11/22/2024, 3:32 PM**Reservation Summary**
- **Name**: ${reservation.firstName} ${reservation.lastName}
- **Email**: ${reservation.email}
- **Phone Number**: ${reservation.phoneNumber}
- **Arrival Date**: ${new Date(reservation.arrivalDate).toLocaleDateString()}
- **Departure Date**: ${new Date(reservation.departureDate).toLocaleDateString()}
event.reply('#builtin_text', { text: formattedReservation })*