Nov 21, 2023 05:44 AM
Background
I am using a "Search Records"-module in Make Automation to compare data in a scenario (=item for sale) against records matching specific criteria in Airtable (=user wanting to buy an ite, like a "search request").
Desired Behaviour
The search formula SHOULD return the records where:
1. Container Brand = Container Brand OR Container Brand = empty OR Container Brand = empty AND
2. Height Value = empty OR Height = empty OR Height Value = +/-8 of Height AND
3. Weight Value = empty OR Weight = empty OR Weight Value =+/-10 of Weight
In plain language: Return those records where the Container Brand matches the customer preference AND container sizing is +/- close enough to the height & weight of the customer. If value is missing, then assume a match as the business decision is to avoid "false negatives", thus better inform the customer too many, than too few times.
Formula:
AND(OR({Container Brand}={{emptystring}},"{{52.Container.Brand}}"={{emptystring}},{Container Brand}="{{52.Container.Brand}}"),{{if(57.Height.Value != null; ",AND({Height}<=" + sum(57.Height.Value; 😎 + ",{Height}>=" + sum(57.Height.Value; -8) + ")"; emptystring)}}{{if(57.Weight.Value != null; ",AND({Weight}<=" + sum(57.Weight.Value; 10) + ",{Weight}>=" + sum(57.Weight.Value; -10) + ")"; emptystring)}})
Problem: The formula seems invalid. Any suggestions? Note: I am a novice/beginner and have already tried asking Chat GTP 4 for help, but to no avail. I think I need some "human" support 😄 I have close to zero knowledge on how to build airtable formulas.
CommentsThe above described formula was build by modifying an existing, fully functional formula (see below). I removed search criteria "Main Canopy", "Reserve Canopy", "AAD" and added the "Container Brand".
AND(OR({Main Canopy Included}={{ifempty(52.`Main Canopy`.Included; "false")}}(),{Main Canopy Included}=false()),AND({{ifempty(52.`Reserve Canopy`.Size; 0)}}>={Reserve Canopy Size Lower},{{ifempty(52.`Reserve Canopy`.Size; 100000)}}<={Reserve Canopy Size Upper}),OR({AAD Included}={{ifempty(52.AAD.Included; "false")}}(),{AAD Included}=false()){{if(57.Height.Value != null; ",AND({Height}<=" + sum(57.Height.Value; 😎 + ",{Height}>=" + sum(57.Height.Value; -8) + ")"; emptystring)}}{{if(57.Weight.Value != null; ",AND({Weight}<=" + sum(57.Weight.Value; 10) + ",{Weight}>=" + sum(57.Weight.Value; -10) + ")"; emptystring)}})
Nov 26, 2023 03:43 AM
Follow-up: Anyone has a hint/idea for me?