Hi Clay S. can you please help me with this table? https://app.clay.com/workspaces/494995/workbooks/wb_0sxsqgw4TGBCR5FTBRY/tables/t_0sxsqhiYWsAwE4iz2xN/views/gv_0sxsqhjUNxGabgfJb8K I'm trying to get the country's full name using AI, however, it keeps returning the 2-letter country code
The AI returns the 2-letter country code because the output field or prompt is likely set up to extract or display the code, not the full country name. To get the full name, adjust your AI prompt or output field to specifically request the countryβs full name instead of its code when configuring the "Use AI" column in your table.
I'm trying but the it return 2-leltter country anyway, here is the prompt I'm using: #CONTEXT# You are tasked with converting 2-letter country codes to their corresponding full country names using the ISO 3166-1 alpha-2 standard. #OBJECTIVE# Convert the value in the 'Country Enriched' column from a 2-letter country code to the full country name. If the input is invalid or empty, return "Unknown Country". #INSTRUCTIONS# 1. Read the value from the 'Country Enriched' column. 2. Check if the value is a valid ISO 3166-1 alpha-2 country code. 3. If valid, return the corresponding full country name (e.g., "US" β "United States"). 4. If the value is invalid or empty, return "Unknown Country". #EXAMPLES# Input: "US" β Output: "United States" Input: "FR" β Output: "France" Input: "DE" β Output: "Germany" Input: "ZZ" β Output: "Unknown Country" Input: "" β Output: "Unknown Country"
Hi Khush here is a screenshot:
I tried the first ten rows and for some records works for some other not
https://clayrunhq.slack.com/archives/C025KSBLPGX/p1749827197996759?thread_ts=1749826340.813069&cid=C025KSBLPGX I can see you haven't declared the input column as /Country within the prompt, try fixing that and check
I personally follow the practice of testing my prompt directly with the LLM before setting it up in the enrichment column. When I gave your prompt to ChatGPT, it returned a Python-based explanation instead of the expected output. So, I added an extra line of instruction to your original prompt, and it worked well. Here is the modified prompt: I'm trying but the it return 2-leltter country anyway, here is the prompt I'm using: #CONTEXT# You are tasked with converting 2-letter country codes to their corresponding full country names using the ISO 3166-1 alpha-2 standard. #OBJECTIVE# Convert the value in the 'Country Enriched' column from a 2-letter country code to the full country name. If the input is invalid or empty, return "Unknown Country". #INSTRUCTIONS# 1. Read the value from the 'Country Enriched' column. 2. Check if the value is a valid ISO 3166-1 alpha-2 country code. 3. If valid, return the corresponding full country name (e.g., "US" β "United States"). 4. If the value is invalid or empty, return "Unknown Country". #EXAMPLES# Input: "US" β Output: "United States" Input: "FR" β Output: "France" Input: "DE" β Output: "Germany" Input: "ZZ" β Output: "Unknown Country" Input: "" β Output: "Unknown Country" Don't give me any additional explanations or try to find mistakes with my input and use the above instructions to give me the answer to the below input in the desired format: Input to parse: "AF" Attached to this message is an image of the output received by ChatGPT.
Heyβyouβll want to specify in the AI prompt that you need the full country name, not the 2-letter code. Once thatβs clear in the output settings, it should return the correct format. You can see it working in your table now. Let me know if you need help tweaking the prompt further.