How do I filter a google sheet by values in two columns? One column is looking for an “x”. If the “x” is there, then it will look in another column for a number. If the number is greater than 7, then it will trigger an email in a final step. How can I build this?
Interesting.
I think a Code Piece checking the following Key/Inputs to do a logic test (return TRUE if meets params or FALSE if otherwise).
Keys:
textContains = Value from previous step we check has an “x”
textLength = Value from pervious step we check is larger than 7 characters
export const code = async (inputs: { textContains: string; textLength: string }) => {
if (inputs.textContains.includes('x') && inputs.textLength.length > 7) {
return true;
}
return false;
};
A branch if TRUE, send email, if False do the other thing.
This is assuming that you’re getting the values row by row in your flow.
Are you trying to do a filter and email on a Dataset that you already have? If so, I would add a Loop that includes Google Sheets Piece using Get Row, Code Piece, Branch Piece, Email Piece, and Google Sheets Piece using Get Next Row.
What is your usecase? Piecemeal on each flow or trying to do this on an existing dataset?
That’s really helpful. Thanks. In the code, can you please modify the second column to trigger whenever it hits 5, 10, or 15? We don’t care about 7, just each of these numbers 5, 10, 15. So it should check the first column for “x” and then the value if it matches 5, 10, or 15. How do we make sure the correct columns are checked here?
I don’t understand what you mean by trigger the second column.
Can you give a bit more information of what you’ve got and where you’re going with this flow?
Basically I am looking to send emails out every time the weekly number hits 5, 10, and 15. But the second column as to be marked with an X as well in order to send out the email.