Clay Icon

Adding Row Numbers to a Table for Odd Row Enrichment Run - Seeking Alternative Solution

Β·
Β·

Hi, it is possible to add a column to a table that is the row number? I have asked for an AI formula but it says it is stuck on an infinite loop? The problem I am looking to solve is to only have a particular enrichment run on odd row numbers and the system row number is not a column I can select. Any other solution is appreciated.

  • Avatar of Lee A.
    Lee A.
    Β·
    Β·

    Example formula prompt: this column should start at 1 and then increase by 1 on every row or new row added for example 1, 2, 3 and so on

  • Avatar of Rubi S.
    Rubi S.
    Β·
    Β·

    hey Lee, sadly there isn't a way to do this currently, but perhaps the could filter out by the columns that display error on the formula results or, a workaround could potentially be:

    1. 1.

      export your table to a CSV

    2. 2.

      edit it with Excel or sheets to assign a number to each column

    3. 3.

      make a new Clay table without the enrichments, only your raw leads data and the new numerated column

    4. 4.

      Use Clay's lookup function to search for the numbered column on your Main table and map it, then you'd be able to filter based on the row number.

  • Avatar of Clay T.
    Clay T.
    APP
    Β·
    Β·

    Hi Lee A., sorry for the delay here! Is there any other metric other than odd rows and even rows that could segment the rows you're wanting to run?

  • Avatar of Clay T.
    Clay T.
    APP
    Β·
    Β·

    Rubi S. has some great suggestions here - thank you for jumping in!

  • Avatar of Lee A.
    Lee A.
    Β·
    Β·

    Hi Anjali D. Rubi S. I am looking for an automated process. I want to use 2 different automations for the snippet. Maybe I create a formula that if the first name starts with A, C, E, etc, run X and if it starts with B, D, etc, run Y. I am looking to have variety within the content creation with as much automation as possible. Would this work?

  • Avatar of Rubi S.
    Rubi S.
    Β·
    Β·

    yeah you can do that or just use ask the AI formula generator to randomize between certain numbers, then condition your enrichments to only run if the formula displays 1 or 2, for example

  • Avatar of Lee A.
    Lee A.
    Β·
    Β·

    Hmm will try that, thanks!

  • Avatar of Clay T.
    Clay T.
    APP
    Β·
    Β·

    Lee A., got it! That's an interesting idea - you could definitely use an AI generated formula and tell it to tag rows as either X or Y depending on the letter with which the words in that column start with. And then you can set up a condition for your enrichments to only run if the formula returned either X or Y. Do you know how to set up formulas and conditional settings? Let me know

  • Avatar of Lee A.
    Lee A.
    Β·
    Β·

    I’ve just added this prompt: this column should have a random number of either 1 or 2 added so that the table is roughly 50% of each

  • Avatar of Lee A.
    Lee A.
    Β·
    Β·

    Which came up with this formula: {{Row Number}} + Math.floor(Math.random() * 2) + 1 But it says can’t save because of infinite loop….🀯

  • Avatar of Lee A.
    Lee A.
    Β·
    Β·
  • Avatar of Lee A.
    Lee A.
    Β·
    Β·

    Also this is causing an infinite apparently: {{New Column}} || [β€œA”, β€œC”, β€œE”, β€œG”, β€œI”, β€œK”, β€œM”, β€œO”, β€œQ”, β€œS”, β€œU”, β€œW”, β€œY”].includes({{Person - Name}}?.[0]?.toUpperCase()) ? 1 : 2

  • Avatar of Clay T.
    Clay T.
    APP
    Β·
    Β·

    Hi Lee A., sorry for the delay here! I see your "AI Content Ref" column - is it working as expected?