Perform Calculations on Private Data

I’m trying to perform calcuations on private data, but I can’t seem to get it to work.

For example, let’s say I’ve created a buying and selling site and I want to uplift the price the seller has listed when displayed to the buyer. I don’t want the buyer knowing what the original price was and I don’t want either to know what the uplift is.

Sell Price = $100 (visible to seller only)
Uplift = 10% (visible only to admin)
Buy Price = $100 + 10% = $110 (visible only to buyer)

Because the uplift is hidden from the seller, I can’t do the calculation when the seller posts the item, and because the sell price and the uplift are hidden from the buyer, I can’t calculate them when they’re viewed either.

Essentially the end price becomes $0 in both cases because the uplift is hidden (i.e. 0) multipled by anything = 0

Any help with this one?

Hi there, @SJL… you may know this already, but if you use a backend workflow to do the calculations, you can ignore privacy rules when you run the workflow. Have you already considered/gone down that path?

Best…
Mike

2 Likes

Thanks @mikeloc

That sounds like a pretty solid solution. Are there any risks with this (as the bubble manual says to use with caution!)

The warning in the manual is just telling you to be careful because you are messing with security/privacy settings. So, sure, there are risks if you do something like giving unauthenticated users the ability to bypass privacy rules and modify sensitive data… but I’m sure you wouldn’t do something like that, so I’m guessing you will be fine. :wink:

Thanks @mikeloc - I tried it out and it works perfectly!

2 Likes