Dec 29, 2022 04:19 AM
Hello,
Thank you in advance for your help. I explain you my project 😃
I am in charge of a product sourcing agency.
I need to make a catalog of my products, but I need to be able to change the price of the product depending on the country of delivery.
Example:
Product 1 : USA : Price 10 Dollars
Product 1 : FR : Price 15 Dollars
Product 1 : CA : Price 20 Dollars.
If you can help me with this it would be great 😃
I don't know how to do it, with a select single maybe?
Solved! Go to Solution.
Dec 29, 2022 11:23 AM
Hey @MrSharks!
There are quite a few ways to accomplish what you're looking to achieve, each with varying complexity.
For the sake of a simple demonstration, here's a quick look at a possible approach:
I created a simple table with similar pieces of data that you provided.
There is a product name, static price (in USD), and a single-select field with options to designate the country of delivery.
I created a formula field called Corrected Price with the following formula body:
IF(
AND(
{Country of Delivery},
{Price (USD)}
),
SWITCH(
{Country of Delivery},
"USA", {Price (USD)},
"FR", {Price (USD)} * .96,
"CA", {Price (USD)} * 1.4
)
)
The formula will manipulate the value of the Price (USD) field based on what the single-select field value is.
I just had it do some random arithmetic to change the value; there's no real method to the madness.
If you like this approach, you'll need to change out the statements in the switch function in order to get your desired result.
Here's what the results look like with that formula:
One disadvantage to this approach is that it requires an upfront time investment from you to input all the potential values you want to account for in the switch function.
If you have a relatively small number of countries or values that need to be accounted for in the single-select field, then it's not much of a concern.
If you expect to be continually adding in new values, then that amount of technical debt may quickly become a disadvantage.
We could definitely get more granular and explore more possible routes for approaching your problem, but we'd definitely need more details in order to dig further.
Dec 29, 2022 11:23 AM
Hey @MrSharks!
There are quite a few ways to accomplish what you're looking to achieve, each with varying complexity.
For the sake of a simple demonstration, here's a quick look at a possible approach:
I created a simple table with similar pieces of data that you provided.
There is a product name, static price (in USD), and a single-select field with options to designate the country of delivery.
I created a formula field called Corrected Price with the following formula body:
IF(
AND(
{Country of Delivery},
{Price (USD)}
),
SWITCH(
{Country of Delivery},
"USA", {Price (USD)},
"FR", {Price (USD)} * .96,
"CA", {Price (USD)} * 1.4
)
)
The formula will manipulate the value of the Price (USD) field based on what the single-select field value is.
I just had it do some random arithmetic to change the value; there's no real method to the madness.
If you like this approach, you'll need to change out the statements in the switch function in order to get your desired result.
Here's what the results look like with that formula:
One disadvantage to this approach is that it requires an upfront time investment from you to input all the potential values you want to account for in the switch function.
If you have a relatively small number of countries or values that need to be accounted for in the single-select field, then it's not much of a concern.
If you expect to be continually adding in new values, then that amount of technical debt may quickly become a disadvantage.
We could definitely get more granular and explore more possible routes for approaching your problem, but we'd definitely need more details in order to dig further.
Jan 01, 2023 01:49 PM
Thanks for youre help !!!!!! Can you help me for For another question? or project? is it possible to write you live or on discord?