How to Enrich Accounts with U.S. Billing State Data in Clay
Hi everyone! I'm new to Clay and I'm still learning have been watching the courses. I'm looking to see if i can run a clayagent to help me look at a list of Accounts I have with US Billing state column available, but not the address. This is not the HQ, so a basic enrichment won't be of use for me, these Accounts have multiple sites. I tried setting up a prompt to look at the Account and its Billing state - and have it look for the associated address if any. I don't think this was correct- anyone have any ideas? #CONTEXT# You are tasked with extracting company names and matching them to their associated addresses based on their billing state. #OBJECTIVE# Extract the company name from the column {{Account Name}} and cross-check with the column {{Billing State/Province}} to find the state associated with {{Account Name}}. If {{Billing State/Province}} is null, look for a U.S. address associated with {{Account Name}}. #INSTRUCTIONS# 1. For each row, extract the company name from {{Account Name}}. 2. Check if {{Billing State/Province}} has a value: a. If yes, find the address associated with {{Billing State/Province}}. 3. Return the matched address and the company name. 4. If no address is found, return 'No address found'. #EXAMPLES# Example input: - {{Account Name}}: "Acme Corp" - {{Billing State/Province}}: "MA" Expected output: "company_name": "Acme Corp", "matched_address": "123 Main St, Springfield, MA, United States" Example input (with null cross-check column): - {{Account Name}}: "Beta LLC" - {{Billing State/Province}}: null Expected output: "company_name": "Beta LLC", "matched_address": "456 Market Ave, New York, United States"