← All Apps Scripts templates
/
Find if a lead use Monday

Find if a lead use Monday

  1. Create a new Google Sheets file
  2. Go to Extensions → Apps Script
  3. Remove all the code and copy-paste the following instead
  4. Save your project and go back to your sheet
  5. Use =useMonday({email}) like classic Google Sheets Formula

The new function in Google Sheets:


useMonday()

The code to paste in Apps Script inside Google Sheets:


/**
* Know if someone uses Notion
*
* @param {string} email.
* @return true or false
* @customfunction
*/

function useNotion(email) {

  url = "https://www.notion.so/api/v3/getLoginOptions";
  Logger.log(url)
  var options = {
    "muteHttpExceptions": true,
    "method": "post",
    "headers": {
      "Content-Type": "application/json",
      "Accept": "application/json"
    },
    "payload": JSON.stringify({
      "email":email
    })
  };
  
  var response = UrlFetchApp.fetch(url, options);

  Logger.log(response)

  var responseCode = response.getResponseCode();
  var responseBody = response.getContentText();
  if (responseCode === 200) {
    Logger.log(response)
    if(JSON.parse(response).hasAccount == true){
      return "✅"
    } else {return "❌"}

  } else {
    Logger.log(Utilities.formatString("Request failed for %s, got %d: %s", responseCode, responseBody));
    return "Error";
  
}}

/**
* Know if someone uses ClickUp
*
* @param {string} email.
* @return true or false
* @customfunction
*/

function useClickUp(email) {

  url = "https://app.clickup.com/verification/v1/email?email="+email;
  Logger.log(url)
  var options = {
    "muteHttpExceptions": true,
    "method": "get",
    "headers": {
      "Content-Type": "application/json",
      "Accept": "application/json"
    }
  };
  
  var response = UrlFetchApp.fetch(url, options);

  Logger.log(response)

  var responseCode = response.getResponseCode();
  var responseBody = response.getContentText();
  if (responseCode === 200) {
    Logger.log(response)
        Logger.log(response)
    if(JSON.parse(response).email_taken == true){
      return "✅"
    } else {return "❌"}
     

  } else {
    Logger.log(Utilities.formatString("Request failed for %s, got %d: %s", responseCode, responseBody));
    return "Error";
  
}}

/**
* Know if someone uses Monday.com
*
* @param {string} email.
* @return true or false
* @customfunction
*/

function useMonday(email) {

  url = "https://auth.monday.com/auth/login/email_first_login?email="+email;

  Logger.log(url)

  var options = {
    "muteHttpExceptions": true,
    "method": "get",
    "headers": {
      "Content-Type": "application/json",
      "Accept": "application/json"
    }
  };
  
  var response = UrlFetchApp.fetch(url, options);

  Logger.log(response)

  var responseCode = response.getResponseCode();
  var responseBody = response.getContentText();
  if (responseCode === 200) {
    Logger.log(response)

    if (JSON.parse(response).accounts_count > 0){
      return "✅"
    } else {return "❌"}
   

  } else {
    Logger.log(Utilities.formatString("Request failed for %s, got %d: %s", responseCode, responseBody));
    return false;
  
}}

Reach us if the process is unclear or if the script is outdated
Apps Scripts template

Find if a lead use Monday

Last updated
4/4/2023
Built by
Avatar Placeholder
internal

Similar Apps Script for

Monday

in Google Sheets

No similar items yet.