ClinicalTrials Study Fields¶
Retrieves available field values from ClinicalTrials.gov for specified study fields. It queries the public API endpoint for field value statistics and returns the raw JSON results and a small metadata summary as strings. Handles common network and JSON parsing errors gracefully by returning error JSON strings.

Usage¶
Use this node when you need lists of values associated with specific ClinicalTrials.gov study fields (e.g., conditions, intervention names) to support downstream filtering, validation, or UI auto-complete. Typically placed early in a workflow to fetch canonical field values which can inform subsequent search or analysis nodes.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| type | False | STRING | Optional filter for field value types as supported by the ClinicalTrials.gov stats/field/values endpoint. | Study |
| fields | False | STRING | Comma-separated list of study fields for which to retrieve values. | Condition, InterventionName |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| results | STRING | Pretty-printed JSON string containing the API response with field values for the requested fields. | { "FieldValues": [ { "Field": "Condition", "Values": ["Diabetes Mellitus", "Hypertension"] } ] } |
| metadata | STRING | Pretty-printed JSON string with a minimal summary, including result_count. | { "result_count": 2 } |
Important Notes¶
- Network dependency: Requires internet access to query ClinicalTrials.gov; a 30-second request timeout is enforced.
- Error handling: On failures, outputs are JSON strings indicating the error (e.g., {"error": "Network error"}).
- Input flexibility: All inputs are optional. If omitted, the node uses its default fields value.
- Output format: Both outputs are JSON strings (not objects). Downstream nodes expecting structured data should parse the strings.
- Field names: The accepted field names and type values must match what ClinicalTrials.gov supports for the stats/field/values endpoint.
- Result count: The metadata's result_count reflects the length of the top-level response structure returned by the API, which may vary by endpoint behavior.
Troubleshooting¶
- Network error: If results contain {"error": "Network error"}, verify internet connectivity, firewall rules, and retry later.
- JSON decode error: If you see {"error": "JSON decode error"}, the API may have returned invalid or unexpected content; retry or adjust inputs.
- Empty or unexpected results: Confirm the field names in 'fields' are valid for the ClinicalTrials.gov stats/field/values endpoint.
- Slow responses or timeouts: Reduce requested fields, try again later, or check service status.
- Downstream parsing issues: Remember outputs are strings; ensure downstream nodes or scripts parse the JSON before use.