Calclate with a filtered value

Hi Adalo community,

Any ideas how I could calculate with a filtered value?

I would like to add a delivery cost that depends on where a logged in user is to a product price
when they order it.

I managed to display a DeliveryCost with a filtered list, but could not pick up the value out of it.
My goal is to set it to Payment Amount of Stripe.

image
(Relationship Many Products, Many DeliveryCosts)

your help is much appreciated,

Gotz

Welcome to the community @gotz! :partying_face:

You could do this with getting user location with adalo’s new location features (Location | Adalo Resources) and match that city with the collection record city. Could you share your current setup with some screenshots or from a video, so we could get a proper solution?

Thank you for your advice @dilon_perera
It looks useful. However, the location feature is not exact what I need now. My problem is not how to get locations, but how to get and use one value from related multiple ones.
Sorry for the late reply because actual data is more complicated and written in Japanese, so I prepared simple one.

Case 1
A user lives in Okinawa and buys product A. Then DeliveryCost will be 1000.
image

Case 2
Another user lives in Hokkaido and buys product A. Then DeliveryCost will be 5000.
image

The DeliveryCosts are related to the User’s locations, so one of them should be added to the product’s price when it is charged.

product
image
user


stripe
image

Gotz

So you want like, if the user want to purchase then the total would be 1000+1000=2000 right?

Why you need a relation with DeliveryCost and products. With your setup you should be able to get logged in user’s > location’s> DeliveryCost’s > Cost > SUM + all product’s price.

Thank you @dilon_perera
Your advice is nice. Unfortunately, trying the formula, DeliveryCosts other than Product A were summed up too. (Sorry my example was too simple)
DeliveryCosts depend on the Location and the PRODUCTS, like deliveries for a pencil and a TV are not the same price.

Any other better solution will be appreciated.

Oh yeah… You can filter that with current order’s products. Could you share your full setup with a video so I can share a video?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.