How to use Javascript to return yes or no value if value exists?

  • 24 February 2022
  • 1 reply

Userlevel 1

How can I get this to return a yes or no if it exists?


const API_KEY = "X",
      boardId = X;

const sendRequest = async (payload) => {
  const response = await fetch("", {
    method: "POST",
    body: JSON.stringify(payload),
    headers: {
      "content-type": "application/json",
      authorization: API_KEY,

  const results = await response.json();

  return results;

const getItem = async () => {
  const query = `
      query {
        items_by_column_values (board_id: ${boardId}, column_id: "email_1", column_value: "${}") {

  const response = await sendRequest({

  const results =['items_by_column_values'][0].id;

  return results;

const response = await getItem();

output = {
   id: response

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +11

Hey there, @alexadagostino!

I can’t advise on how to do that using a Code step. But, it looks like you might be trying to run a search in to get certain column values, and check whether they were found or not, is that correct? 

If so, as an alternative you could use the Get Item by Column Value search action for to run the search, then you could add a Filter step or use Paths to check whether the _zap_search_was_found_status field is true or false (true indicates that it found something, false indicates that nothing was found). Would that work for your desired workflow here?