I'm trying to extract the first record found's email value but no formula I attempt works with me to do so.
Hey Amit, thank you for getting back to me. I donโt think Iโm using the metaprompter for the HTTP API column. Is that native to Clay? Not sure what it is.
Can you escalate this to a person? Here's the table referenced: https://app.clay.com/workspaces/217230/workbooks/wb_0t3kgionw6znA4RD435/tables/t_0t5e4hdrTCic7gu2D3U/views/gv_0t5076s6zm3hnyu3tXb
Gotcha can you please provide me the updated, complete prompt for the HTTP API agent
Oh I see - is there something supplemental I should add to the dynamic variable exclusively? Review the output sample I provided you and the HTTP API prompt: --- Formatted JSON output: { "Status": "EscalationNoContactsFound", "Reason": "Searches (web and state resources) did not locate an authoritative firm record or principals for 17 MILE DRIVE LLP with license PAR 8379 in California.", "NextActions": ["Use California Board of Accountancy license lookup to query PAR 8379 and firm name directly; if needed, email info@cba.ca.gov or call CBA for principal-of-record details.", "Search California Secretary of State bizfile for the entity name and order the statement of information or annual report to retrieve officers/managers.", "Check California CPA Society member directory and LinkedIn for '17 MILE DRIVE LLP' principals.", "If the firm phone is located, call main line and request managing partner name."] , "HelpfulLinks": ["https://bizfileonline.sos.ca.gov/search","https://search.dca.ca.gov/advanced?BD=19"], "Evidence": ["CBA homepage and license lookup guidance: https://www.dca.ca.gov/cba โ no matching public record for PAR 8379 or firm name found via initial searches."] } HTTP API Prompt: The HTTP API prompt is: --- { "messages": [ { "role": "system", "content": "You are a specialized decision agent tasked with determining whether a manual search step is required based on structured output from a prior automation process. You will receive either plain text or JSON data. ### Core Task: Determine whether a **manual search step is required**. A **manual step** includes actions such as calling, emailing, submitting formal requests, or retrieving non-public information via human interaction. ### Decision Rule: If the input indicates that: - automated data was insufficient, **and** - manual follow-up is recommended or necessary, ...then output **\"Yes\"**. Otherwise, output **\"No\"**. ### Input Handling: - If input is JSON, analyze Status, Reason, NextActions, and Evidence fields - If input is plain text, analyze the content directly ### Output Constraints: - Only return one word: **Yes** or **No**. - Do **not** include any explanations, JSON, or other output formats. Always return exactly \"Yes\" or \"No\". No code blocks. No markdown. No comments." }, { "role": "user", "content": "Formatted JSON" } ], "temperature": 1, " --- Is there a command I should add to the Formatted JSON variable or something because it's appropriately mapped between two quote symbols.
Getting this error message despite it being correct: --- Failed to parse body input: Expected ',' or '}' after property value in JSON at position 1078 (line 1 column 1079) while parsing '{"messages": [{"role": "system", "conten' Troubleshoot with AI Beta It looks like there's an issue with the JSON formatting in the "Manual Search?" column. Here's how to troubleshoot:
Identify the Problem: The error message indicates that the JSON structure being sent to the HTTP API in the "Manual Search?" column is not valid. There's a missing comma or curly bracket.
Review the "Manual Search?" Action:
Go to the "Manual Search?" action configuration.
Examine the Body input, which contains the JSON payload.
Look for any missing commas or curly brackets, especially around line 1 column 1079.
Validate JSON Formatting:
Copy the entire JSON payload from the Body input into a JSON validator tool (you can search online for "JSON validator").
The validator will pinpoint the exact location of the error, making it easier to fix.
Correct the JSON:
Carefully add the missing comma or curly bracket in the Body input of the "Manual Search?" action.
Ensure that all strings are properly enclosed in double quotes.
Test the Fix:
Run the "Manual Search?" action on a single row to see if the error is resolved.
If it runs successfully, apply the changes to the entire column.
Optional: Simplify the JSON
If the JSON is too long, you can create a formula column to assemble the entire JSON structure, and then reference this column in the HTTP API configuration. Also, ensure you are not double-stringifying the data.
--- The HTTP API prompt is: --- { "messages": [ { "role": "system", "content": "You are a specialized decision agent tasked with determining whether a manual search step is required based on structured output from a prior automation process. You will receive either plain text or JSON data. ### Core Task: Determine whether a **manual search step is required**. A **manual step** includes actions such as calling, emailing, submitting formal requests, or retrieving non-public information via human interaction. ### Decision Rule: If the input indicates that: - automated data was insufficient, **and** - manual follow-up is recommended or necessary, ...then output **\"Yes\"**. Otherwise, output **\"No\"**. ### Input Handling: - If input is JSON, analyze Status, Reason, NextActions, and Evidence fields - If input is plain text, analyze the content directly ### Output Constraints: - Only return one word: **Yes** or **No**. - Do **not** include any explanations, JSON, or other output formats. Always return exactly \"Yes\" or \"No\". No code blocks. No markdown. No comments." }, { "role": "user", "content": "Formatted JSON" } ], "temperature": 1, "max_completion_tokens": 1500 } ---
Does this formula appear correct to you: ---- ({{Decision-Maker Escalation}}?.response || "")?.replace(/\s*\((https?:\/\/[^\s)]+|mailto:[^\s)]+)\)/g,"")?.replace(/\[(.*?)\]\((https?:\/\/[^\s)]+)\)/g,"$2")?.trim() ---
Doesn't work - can you provide me the natural language instruction to provide the AI that works with the formula?
Yes please give me the formula instead. This is the JSON output I get from the escalation agent as an example: --- {"Status":"EscalationNoContactsFound","Reason":"Public website lists a contact named Karla but provides no title indicating owner/partner; California SOS bizfile search did not return publicly accessible officer/manager data for the entity via quick search.","NextActions":["Contact California Board of Accountancy by phone/email to request the firm's principal of record for license COR 9776.","Order the entity's most recent Statement of Information (annual report) from California SOS BizFile to retrieve officer/officer names.","Call the firm main line (310-781-1234) to request the managing partner or owner name."],"HelpfulLinks":["https://bizfileonline.sos.ca.gov/","https://www.dca.ca.gov/board/accountancy/ (California Board of Accountancy)"],"Evidence":["Company contact page showing Karla and address: https://abundant.tax/contact/","California SOS BizFile search landing: https://bizfileonline.sos.ca.gov/search/business"]} --- I need these details analyzed by the HTTP API agent so please give me the correct formula. The column name for this output is "Response" by the way
