Hello dear Coda.io community,
I’m a Coda user who want to create a MVP of an app for small restaurant owners and their customers. I want to perform a specific automation but can’t achieve it. Maybe have you an idea?
TLDR: I create an app MVP with Coda and I try to find a way to automate “subpages” deletion when a button is triggered to allow the business owner to delete all the old “views” of customers orders in a single click.
As you can see in that video, I’ve actually something like this:
- A “Welcome” page, where the customer can create a new “view” for his order;
- A “Dependencies” page, where you can find the “order.view” table (which is simply the “cart” of the restaurant);
- An “App model - Your order” page, as the model for the customers ordering process;
- An “App view” folder where the view of order are located;
- An “Database” page where all the orders are centralized, containing a button who allow restaurant owner’s to delete all the data in the view.
When the customer clic on “Order”, a new view is created with the formula below.
RunActions(
DuplicatePage(
[App model - Your order],
name: "App view - Votre commande",
parentPage: [App views],
copySubpages: false,
duplicateOptions: "duplicatedata"
)
)
Then, when the customer confirm the order, informations are send inside the restaurant owner’s database (this s*it still need improvement to avoid "partially” complete order… but at least it work!).
RunActions(
AddRow(
[backofficeorder.view]
)
,
ModifyRows(
[backofficeorder.view].Last(),
[backofficeorder.view].[Qty of Dagobert],
[cart.table].[Qté].Nth(1)
)
,
ModifyRows(
[backofficeorder.view].Last(),
[backofficeorder.view].[Qty of Norvégien],
[cart.table].[Qté].Nth(2)
)
,
ModifyRows(
[backofficeorder.view].Last(),
[backofficeorder.view].[Qty of Liégeois],
[cart.table].[Qté].Nth(3)
)
,
ModifyRows(
[backofficeorder.view].Last(),
[backofficeorder.view].[Client name],
[order.clientname]
)
,
ModifyRows(
[backofficeorder.view].Last(),
[backofficeorder.view].[Client address],
[order.clientaddress]),
DuplicatePage(
[App model - Confirm order],
name: "App view - Suivi de votre commande",
parentPage:[App views] ,
copySubpages: true,
duplicateOptions: "DuplicateData")
)
)
Everything work fine as expected. But I want to offer to the restaurant owner the capabilities to delete all the child from “App views” (”App view - Your order” and “App view - Confirm order”) by clicking a button inside the “Danger Zone” as I guess it gonna be very messy / slow if there’s a lot of views in the doc.
When making research, I’ve found the DeleteDoc formula inside Crossdoc package but it doesn’t seem to work for me as expected (and the formula seems to doesn’t been “recognize” anymore).
I also have found this but it doesn’t fit my need (as I’ve understand it).
Do you know any way / tips / hack to achieve my goal as expected?
Thank’s a lot in advance for your (greatly appreciated) help,
Jonathan