Calculate selling price automatically based on markup range cost falls into

Hello all,

I have 2 tables in my app. One is an inventory table with a master data list of SKU details, cost, selling price, etc.

Another table I have is a “SKU pricing scale”. This scale table has few fields: Min, Max, Markup %.
Different price ranges have different markups (e.g. $0-500 = 25% markup, $500-1000 = 20% markup, and so on.)

I’m trying to get the master data list table to dynamically update the “selling price” field depending on where the cost of each SKU falls into the different pricing scale ranges.

Can someone help me with this. I hope what I described makes sense :slight_smile:

Thank you very much in advance.

@moe @Chem

1 Like

You can probably create a pipe to do this using the Tadabase API.

You’d basically query this table via the API and then filter it to find values that are higher than the min and lower than the max. You’d then get the value back and use that in your next step.

If you create a basic app with this example and share it with me (moe@ tadabase .io) I’d be happy to build out the pipe for you on video so you can see what I mean.

Hey @moe

I invited you to the builder, appreciate your help

Thanks. While testing this out I found that we’re missing an operator (“Greater than or equal to” and “Less than or equal to”) in the filter options. We need to add this to make it work, we’ll have this done soon.

I’ll update you here agan in a bit.

1 Like

Sorry about the delay.

Here’s a video demonstrating how to do this with a pipe. I wish it was simpler, but hopefully this can help for now.

Main issue with this which is still being worked on is that if the value falls on an exact number in the max or min field it will not work. For that we need an operator that is “higher than or equal to” and “lower than or equal to”

Please let me know if you have any questions.

2 Likes

Thank you so much @moe

This helped me wrap my head around the Tadabase API and how to tie it all in together :slight_smile:

I’ll keep an eye out for the less/higher equal to operator!

Hey @moe

So I sent you a video regarding decimal values not passing through the API filters.

And one other question I had - is there a way to connect the two tables in such a way that when any of the scales change, the master table would get the updated selling price right away. All SKUs that fall within the updated scale margin, would get updated. Vice versa, if I update a SKU record in the sku table, I can create a table rule “created or edited” to automatically pull in the correct scale at that moment.

I’m curious if there’s a way to make these two tables “sticky” and have the scale always push.

Hope that makes sense.

@simplyvlad where did you send the video to? I can’t seem to find it.

To answer you your question, yes this is possible.

Simply add a connection field from the inventory table to the pricing scale table.

Then in the Pipe request when you find the proper record, retrieve the ID of the record and pass that into the record rule in the Connection field.

In the app you’ve shared with me I’ve configured it so you can see a working example.

@moe I sent the video in direct message here in the forums. I just emailed it as well.

So apparently this platform has a private messaging system. Just found lots of direct messages I’ve never seen before. Yikes.

As to the bug, we’re gonna have that fixed over the weekend.

That filtering bug is fixed.

@moe Haha, no worries!

Awesome thank you so much. Let me know once that operator gets added in

Will do.

It was already added, just waiting for our next update to go live. Should be hopefully this Saturday night (Dec 11th).

@moe

Sent you another video in Personal Messages on this forum again. Just keep getting hit with little roadblocks haha :slight_smile:

Hey @moe

Did that new operator get pushed through? Is it ready to use?

Haha sorry for many questions all at once, I have to get users onboarded in about 6-7 days so I’m in a huge rush!

Yes, its been added.

You can test it with the operator names:
higher than or equal to’ and ‘lower than or equal to

Let me know if you have any more issues with it.

@moe The new operator works great! You guys are fast! I really appreciate it.

Quick question. I have an annoying validation popup for some reason even though my values are correct and go through. here is a video:

it actually doesn’t show it as well here but basically the number value form shows a validation message: please enter a valid value. the nearest are 1 and 2

is there a way I can remove that, maybe CSS but I couldn’t find the selector

That is so strange. I will look into that right away.

It’s a browser feature, I don’t think CSS can disable it. But I’m going to check asap.

Is there a way to disable “inline-edit” based on conditions?

I have a table here and it would be cool if there was an option to “disable inline edit” if condition is this.

See screenshot screenshot

Thanks moe :slight_smile:screenshot