Dear community,
I seamingly not been capable of doing a simple flow task.
I call an API and in return I get an list of users (id,email, etc).
Data from the flow’s webhook I would like to compare if the user is in the users list and get ONE True/False statement.
but my problem is the result handling within the IF. For each test, I get a True/False outputs depending how many users are in the API result. However I would just like to know if the user exists by email or not and then dependingly create or get the respective user.id.
Could you guide me please. I assume it is a super simple change to make…
Here I have a list of records (users), I feed that list into the If Block, then select just the list of emails using list.email or whatever the field name is for you. Then I filter for values that match the email i’m looking for. I hard-coded the value but you can pass the value in as a variable as well. There is an implicit conversion to boolean in the If Block, so when the filter function returns a list of all the matching values, so long as it isn’t empty, it will be true. You can then use the “THEN” port of the if block to continue the flow in the case the user does exist, and the “ELSE” port to create the user if it doesn’t exist.
Maybe a pit off topic for this question, but how do I get the customers.id out of the list in case it exists. I used ycmCustomers[email=$portalCustomer] but the answer is null …? If I uses it with ycmCustomers[email=“[email protected]”], then it works.