Logic within a zap field

• 3 replies
• 385 views

Is there anyway to do this, without using paths, because I don’t want to have to recreate and duplicate all the steps beyond this point. Over simplifying here:

App 1 has 3 fields, A, B, C

App 2 has 1 field D

Field D is filled with the contents of A or B or C depending on certain conditions. Sort of like a spreadsheet equation. =if(A=apple, then D=Apple) & if(B=Banana, then D=Banana) & if (C=coconut, then D=Coconut)

I don’t want to use a filter because I want it to continue no matter what, even if A was blank

Thanks!

Hi @pshifrin!

There are likely multiple ways to accomplish this (including Paths, or by using multiple Zaps, each with their own filter...the bonus being that you can copy Zaps). What I’m going to recommend first is checking out Lookup Tables, in our Formatter app. Keep in mind that the incoming value has to be an exact match when using a lookup table, so it may not be the best solution in your case.

It would also have to be the case that if you’ve got multiple fields, that only one of them have a value in it. That way, you can add all three here:

Then in the next step you map the output of the lookup table. Could that work in your case, you think?

@nicksimard thanks so much for this explanation, and yes lookup tables would do exactly what I need.

However, I did wind up doing my own version of this: The end results for D was numerical, and there were only 3 possible choices for A,B,C so I used a spreadsheet type formula that basically if A=Yes, then 5600, B=Yes, 5100 and C=Yes, 0. Then the field D is simply A+B+C (of the number transformation).

But absolutely, the lookup table is a much more efficient way to do this and would have combined 4 of my steps into 1.

Thanks!

Thanks for sharing your solution, @pshifrin ! I’m sure other folks will find this helpful as well