Choose variable

Hi Everyone !

Thanks in advance to anyone who wants to give me a little help! I searched for the solution… without success… because I don’t think I’m using the right terms for my search…

My goal : to get the right pourcentage on table A depending of the amount on table B
I use Airtable as source.

Table A
Client | Amount | Pourcentage used
X | 100$ | ??

Table B
Client | begin | end | Pourcentage
X | 1$ | 50$ | 5%
X | 51$ | 150$ | 10%
X | 151$ | 999$ | 15%

In this case, ‘Pourcentage used’ in Table A should be 10%

How should I program this through Make.com ??? Or maybe… directly from Airtable ?

A big thanks in advance ! :slight_smile:

1 Like

This can be accomplished with a switch module! :grinning:

Input would be “amount” from table A.

Cases are if/else. If “amount” matches the pattern, that cases’ output is sent.

Just tested this and it’s working using Regex.
5% - \b(0|[1-9]|[1-4][0-9])\b
10% - ^(5[1-9]|[6-9]\d|1[0-4]\d|150)$
15% - Else

2 Likes

Thanks for the answer… But actually… I found a very SIMPLE solution !!! :slight_smile:

And it works very well !!! :slight_smile:

3 Likes

Hey @Alex_Guillaume welcome to the community :wave:

I just wanted to quickly step in and say awesome work figuring this one out. :clap: Thank you very much for sharing what did the final trick with the rest of us. This is super valuable and could be incredibly helpful to many others :pray:

1 Like