Forum Documentation Showcase Pricing Learn more

Workflow...Delete data from database

Background…to give my issue some context

I have a page that is to create an order.
It has a Dropdown to choose a customer from and then you can choose the products to order but checking a check box.
My workflow creates an Order when the customer is selected, that holds the Customer
Creates an OrderItem when a product is selected, that has the Order created above and the product selected

What I need to do is…if a checked product is unchecked I need to delete that OrderItem…
I cannot work out how to do this…can anyone help?


Maybe two actions, like this ?

Then Add / Remove the current row’s Order Item from Order’s Item List ?

Yep have two actions

its the second action I am having problems with.

I do the following
To Delete
Do a Search for… OrderItem
Do a search For … OrderItemm, with Constraints of Order = Page Order and Product = Cells Product

I get Error message Delete thing…To delete should be anything saveable but right now its a yes/no…not very useful

That means that you’re going to far in the expression of the thing to delete. You’re going to a field. You want to delete the entire thing right? Not a field? If it’s a field make a change to thing is what you want, and you make the field empty.

So, I tried it this way…and it works.

The checkbox value changing adds the order, and sets a custom state on the page to this order.

Lefthand list is just a list of available products.

The Right Arrow adds to a list (product_list … a list of products on the order.

The righthand list is a search for products from the product list of the current order state.

The trash removes it…

So it may be a case of figuring out how to get it to work for checkboxes ? Although I did try to filter the left hand list based upon the product existing in the right hand list (so the common "move things between two boxes UI element) but struggled a bit !

Thank you so much for your help!

I figured it out finally.
When I create the order item, I set the state of that cell to have the orderitem in it, so when i want to delete it the ‘thing’ i want to delete is in that cell :smile: