Determining price of a job dynamically based on a set of variables

I’m building a courier platform to offer a counter to counter service using public transport. The prices are fixed based on a set of variables:

  • The start point
  • The end point
  • The type and number of packages
  • The weight of the package

I have already built a workflow to create a new job - it captures the above variables (including others such as sender, receiver, etc).
I need help building a pricing table from which the platform can pull the price based on the variables.
To narrate the requirement a bit better, I’ve attached a simplified table showing the variables and their relation to the pricing.

Hope someone can help.

Thanks

Hello!

This is a suggested approach:

Database

Job
Title (text)
Price (price)
Startpoint (starpoint)
Endpoint (endpoint)
Package type (package type)
Weight (weight)

Price
Price (number)
Startpoint (starpoint)
Endpoint (endpoint)
Package type (package type)
Weight (weight)

Startpoint
Title (text)

Endpoint
Title (text)

Package type
Title (text)

Weight
(Title)

Logic

  • create all your startpoint, endpoint, package type, and weight entries
  • create all your prices using their respective combination of startpoint/endpoint/pckgtype/weight
  • when a job is created … populate its price field with the respective price entry by means of searching price :first item using the necessary search constraints for startpoint/endpoint/pckgtype/weight which the user can choose by means of UI elements (input elements, dropdown elements … etc etc as preferred)

Hope this helps :+1:t2:

Definitely helps, thank you. It’ll get me out of the starting blocks. I have not used the “:first item” feature before so that’s also something new I now understand better.

The one thing is that I’ll need to repeat this process at least 100 times as the starting number of points (start or end-points) is 10. I’d really love a way to do this that eliminates the repetition.

The one approach that has subsequently crossed my mind is to use your proposed database structure to create a table in excel/sheets and then import directly into the database. I’m quite proficient with excel so I might just end up doing that if there’s no way in Bubble.

Thanks again.

This topic was automatically closed after 70 days. New replies are no longer allowed.