Is there a way I can get a count of results in search for records
More often than not, I am checking if a particular contact exists or not. So it would be great if I could just do:
if (count(xyz) == 1) { do something }
Is there a way I can get a count of results in search for records
More often than not, I am checking if a particular contact exists or not. So it would be great if I could just do:
if (count(xyz) == 1) { do something }
If you examine the runs, it will indicate how many records were found. You can also use the script: record_collection_appName_1234.length
to know the number of records returned.
After a search, if you type βrecordβ, you should see one that says record_collection_appName_1234. This gives you access to the collected data from the search.
What I usually do is a conditional on the collected value (in your case βEmailβ) and filter by "Is empty".
There is no need to do the .length
because if the search is empty, then the conditional will be true.
Thank you @Luis
That helps alot and solves my current question. Could you also show a screenshot of how you use the isEmpty
function. Having an extra tool never hurts.
It looks something like this:
What this does is that if Search for Records does not return any values (empty), the conditional action will be true and perform the actions you want.