Clay Icon

Automate User Table Updates Based on Existing Company Rows

·
·

Request: Write to Other Table, but only a column(s) when rows already exist, meaning:

  • Table with Companies

  • Table with Users that belong to companies (referenced by a UUIDV4 in a column called company.public_identifier)

I want to send an HTTP request from the Companies Table to the backend to create the company and once the ID has been retrieved I want to trigger a Write to Other Table where it writes the actual database ID for the already existing users and then once that ID has been populated int he users table, execute an HTTP request to create the Users in the database. All can be done automatically with Auto Update and Run If, except for the part of only writing a specific column in another table when the other table already has rows.

  • Avatar of LuisArturo
    LuisArturo
    ·
    ·

    Hey there Victor thanks for reaching out, just to confirm what you want to do is add columns from a company table to a people correct? Have you tried using the ability to select columns from the "Column Table Data" column in a people table to add those columns to a people table before? https://downloads.intercomcdn.com/i/o/w28k1kwz/1319048483/e305ff05c402347d2849be5da27e/image.png?expires=1735839900&signature=129f91f81f3800a159daf9d3ee9731c71e37e51d28528b925f6f9c45869a13b0&req=dSMmH8l6lYVXWvMW1HO4zZeuBUs8ru%2BtgMzNABoTMSAoEijtzFTQmIkEQIsy%0AV5vu%0A

  • Avatar of Victor C.
    Victor C.
    ·
    ·

    No, let’s say I have a Clay Table called Companies, following columns:

    • Custom ID (UUIDV4)

    • Name

    • HTTP API - Create Company in Database

    • Company ID Database ( Column from the previous Column)

    I have another Users table (Users are associated to companies), with the following properties:

    • User Name

    • Company Custom ID

    • Lookup Company Table (Users.Company Custom ID == Companies.Custom ID)

    • Company ID Database (This is empty unless the company has been created)

    • HTTP API - Create User in Database ( Depends on Company ID Database)

    I have around 25k companies and 25k users. I want to execute the HTTP API - Create Company in Database and once it’s been successfully executed, I want to write the Company ID Database from Companies into the field with the same name into Users, such that HTTP API - Create User in Database executes automatically, today this can’t be done as I need to go to the Users table and manually click Lookup Company Table to retrieve the value of Company ID Database from the Companies table (once the company has been created in the Companies table) and then click HTTP API - Create User in Database to execute the request.

  • Avatar of Victor C.
    Victor C.
    ·
    ·

    LuisArturo let me know if this makes sense

  • Avatar of LuisArturo
    LuisArturo
    ·
    ·

    Ah I see now thank you for explanation. I can definitely see how to would be very useful for users to specify where to write values. Will let the team know about this.

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    Hey there - just wanted to check in here to see if you needed anything else! Feel free to reply back here if you do.

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    We haven't heard back from you in a bit, so we're going to go ahead and close things out here - feel free to let us know if you still need something!

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    Hi Victor C.! This thread was recently closed by our Support team. If you have a moment, please share your feedback:

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    Thank you so much for sharing your feedback Victor C.!