Clay Icon

I have a problem with a conditional column.

I have a problem with a conditional column.

  • I have a field that use API to return values in Json

  • Another field use a formula to obtain specific values of this json

The problem is that sometimes the API return an Error and the field with the formula show me an error message. In this case I need a blank value not an error message.

  • Avatar of Clay Team

    Hey hey! Can you drop the URL for your table here? (if applicable) 🫶 Don't worry, only admins will be able to open your table 😉

  • Avatar of Marco P.

    https://app.clay.com/workspaces/121012/tables/t_e0AKUBtK4iaS/views/gv_vEKX7m6ZT1TY Columns:

    • [Wappalyzer] Tech scraping

    • Wappalyzer: CMS/Marketplace

    Row 5

  • Avatar of Clay Team

    Hey Marco, thanks for reaching out! Taking a look

  • Avatar of Marco P.

    I have three cases: 1) CMS/Marketplace is one of the list 2) is not on the list 3) the API goes in error

  • Avatar of Clay Team

    Got it! I for the example above, I created a separate formula column in case you'd like to check the modification I made and seems to work now

  • Avatar of Clay Team

    Is the other one from Clearbit: CMS/Mark...?

  • Avatar of Marco P.

    The formula you have insert is ok. Now I have problem in the FORMULA column, it contain this formula "_.chain([{{Wappalyzer: CMS/Marketplace}}, {{PredictLeads: CMS/Platform}}, {{BuiltWith: CMS/Marketplace}}, {{PredictLeads: CMS/Platform}}, {{Clearbit: CMS/Marketplace}}]).compact().groupBy().orderBy(['length', 'value'], ['desc', 'asc']).head().value()[0] || "" I need to analyze every field and obtain the most frequent CMS then (if the frequency is the same) win Wappalyzer -> PredictLeads -> Builtwith ... in order then if null in every field "null"

  • Avatar of Clay Team

    Thanks, I'll check this one out too then

  • Avatar of Clay Team

    Marco, I just realized we have an integration to evaluate different list of keywords and prioritize by score based on how often they appear and if they appear in the first, second... position

  • Avatar of Clay Team

    Just adjusted the formula by the way to return "Null" if all are empty. But Arturo O. may have an alternative integration that works better!

  • Avatar of Clay Team

    Just noticed that the column limit was reached though, are there any columns you don't need in your table?

  • Avatar of Clay Team

    Let us know if that change Matthew Q. applied works for you though

  • Avatar of Marco P.

    Now everything is ok! thank you!