How to save card set title as attribute?

(Prakhar Monga) #1

I am using a card set. after card set, i want to set card title as an attribute because i am using it to make a food ordering bot and when a user clicks on order now shortcut in a card after that i want to pass that card title value to another flow or in the same flow.
Any other way around for a food ordering bot?

(Daniel Beckett) #2

Sorry but action names aren’t available as outputs so they can’t be used to dynamically set attributes. You can add shortcuts to the card and use those to trigger another flow and/or set an attribute using the received message from the shortcut.

(Prakhar Monga) #3

ok i am
–>saving the shortcut value in second flow as attribute --> asks user for the quantity he would like to order --> from a google sheet i fetch price of the item recieved from attribute saved earlier–>do the calculation
now i want to save all that info in to a cart and then asks user to add another item in the cart or confirm order.
when user clicks on add another item i am taking user back to the first flow and repeat the procedure.
my question is:
How to store each item ordered with quantity in the cart and when user clicks on confirm order i want to show all items ordered and total bill?
also if user wants to edit order how to do that?

(Daniel Beckett) #4

Not really an ideal use case for the bot at the moment since there’s isn’t a cart feature. It’s technically feasible but will likely involve a lot of workarounds and some trial and error to get setup.

You could save the items to a separate Google Sheet (along with their response path) once they’ve confirmed the item and quantity. Once they’re ready you can then fetch all of the items from the sheet by searching for their response path and display them all back to confirm.

Allowing them to edit the order is a bit more tricky since you need to let them specify what to remove. That could potentially be done by sending the product names as choices for a question and then searching the sheet for that product.

A much easier approach is to use the Payments feature to charge for one product at a time.

(Prakhar Monga) #5

ok if i add the ordered items in to google sheet suppose user orders “2 pizza and a coke”
and after 15 minutes he orders again “1 pizza”.
How could i make a difference between these two orders because every item will be saved in a different row one below other, how would i know which order is from which session.
how to start and end session?

(Daniel Beckett) #6

You could perhaps use an order number system? You can assign each order a unique order number and then provide an option in the bot which asks for an order number (and to be safe, maybe their email, phone number or address) which then lets you fetch back the previous order so that you can update that specific row.