How Can I add Conditional Rules to update database record

Hi All,

I hope everyone is well. I have a question in relation to my app.

I have a field on my checkout; This field is a radio button field. this determines whether or not a customer is charged delivery fee or not.

Please see here:

When the checkout button is clicked and the radio button selection = Delivery then £4 is added to the total order charge.

I need a way of adding this to the order itself. For example… If i have a field in my DB such as Delivery/collection. If the radio button is selected as ‘Delivery’ then i need it to update the order field to ‘Delivery’

which i can then reference at a later date in the order summary page were it currently shows order name, Delivery Address, cost etc…

Thank you

Hi there,

Can you add a Delivery fee of type Number to your Order, and then when Purchase is clicked, If Radio is set to ‘Delivery’ populate this field with the amount of the delivery charge? Your total would be the sum of all order items, along with the delivery charge.

Hi there,

thank you for this. but i need to be able to distinguish what is a Delivery and what is a collection on the restaurants end.

Therefore i would need to be able to know which is which.

I hope im making sense i feel like i may be confusing things here haha!

In the screenshot attached, when the radio is selected as ‘Delivery’ the Delivery Fee will show as its conditionally set to show. And also, the new field i have added which is the Type: This will be conditionally set to show delivery when Radio button is clicked ‘Delivered’ but i then need this to show the Type which would either be collection or delivery based on the Selection of the radio buttons.

The main part is the info being saved into the database so i can reference this on the Restaurant order page so they can determine if this is a collection or Delivery

Thank you

Are you needing to add the value of the delivery (£4) to the database? Or are you needing to indicate on the order in the database whether it was marked Delivery or Collection? If the former, my recommendation before would do the trick, of course with some modifications based on your use-case. If the latter, you can create an Option set of ‘Order Type’ with 2 options: Delivery or Collection. Add this option as a field on your Order data type. Again when the order is created, just reference which Radio button value is selected, and set that radio button’s Option’s value as the Order Type’s value on the Order data entry. Does that make sense?

thank you for coming back to me so quickly.

I have tried this, please let me know if this looks correct to you



Thank you

You are close! For consistency sake, this field should actually be of type ‘Order Type’ instead of type Text:
image

This is where you’d choose that - so you’ll need to delete your text field ‘Order Type’ and create a new one with the Order Type option instead:
image

Additionally, I would set your radio buttons options to be Dynamic, and the choices source is the Order Type option set:
image

Your ‘Choices Source’ will be ‘All Order Types’, and your ‘Option Caption’ will be ‘Current option’s Display’

Now when you create a new order, your Order Type = Radio’s Option’s Value.

Hope this helps!

1 Like