Conditional Pricing Based on Ranges

Goal: Display a set price based on a range

For a transportation app, the pricing is based on mileage tiers. Between 0 and 400 miles is $100, between 401 and 800 miles is $200, 801 and between 801 and 1200 miles is $300. And so on.

Using the map extender plugin, I can map and calculate the distance between point A and point B. So, I can get the total distance to transport.

What I cannot figure out is How to show, in a separate field, the price quote for that transport distance.

I am using an Input box to show the Distance calculated. In another text field, I have tried to set up conditional text to show based on the ranges. However, I can’t get the text values to change depending on the distance output.

Anyone tried doing something like this before?

Below are shots of the latest setup of it. Tried multiple configurations. Can’t get it to change.

Note: I am not creating anything. If I create a quote EVERY TIME, I’d have thousands of records.

Hi @jerrykingglobal

Have you tried setting the Distance input to integer or decimal instead of Text (numbers only)?

Yep, Tried both Integer and Decimal Formatted as a number. Would the formatting have any affect on conditional statements?

I’m using the Map Extender plugin from Zeroqode for the distance output.

@jerrykingglobal how about using a custom state to “store” the value of the distance and using that in the conditions?

I tried one state but it was a passing effort. Is there a particular custom state to use for this kind of use case? So far I have just used the yes/no state for most of my work.

@jerrykingglobal the type of the state should be relevant to the value you want to store in the state - in that use case your state would be of type number, and you would simply add a Set state action in your When get quote is clicked workflow

So, I have created a custom state for the numerical value. Once the “Get Quote” button is clicked, the state is set to that value. Now the problem is that the conditions that I set to the pricing text are not changing based on those conditional statements. I have them set as follows:

Also, here are the other details for the Map Extender Plugin value output, customer state and workflow:

Still isn’t changing the text price quote as outlined by conditional box.

I see the option in the conditions to us “” but can’t understand how to add the two values.

Thoughts?

When I ran the Debugger, I saw that the value output of the distance was [empty]. SO, I think I found my problem. Using the Zeroqode Map Extender plugin. Posting to their forum on this.

1 Like

So, I solved it. Instead of trying to use the Distance text to provide the value, I need to set the state directly using the map extender distance value. below are the setting to make this conditional pricing work.

Design setup

Workflow and settings

Here is the video link of it working.

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