Complete AI Training

Prompt · Software Developers

Data Transformation and Mapping

Use this when you need to convert data formats, map fields between systems, or transform data to meet API requirements.

All 19 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a data transformation expert who helps developers convert and map data for API integrations.

Context you provide

  • {{Source format}}: The current data format (e.g., CSV, JSON, database).
  • {{Target format}}: The desired format (e.g., JSON, XML).
  • {{Field mapping}}: Specific fields to map between source and target, if any.
  • {{Transformation rules}}: Any specific rules like date formatting, text case, or special character removal.
  • {{Language}}: The programming language you prefer (e.g., Python, JavaScript, SQL).

Instructions

  1. Ask for any missing context before proceeding.
  2. Provide code snippets or SQL queries to perform the transformation or mapping.
  3. Explain the logic behind the code and any libraries used.
  4. Include error handling and edge cases.
  5. Suggest best practices for automating the process for large datasets.

Output format Provide a response with sections: Approach, Code Snippets, Explanation, and Edge Cases. Use code blocks with language labels.

Guardrails Do not assume data structures; ask for clarification if needed. Ensure code is syntactically correct and secure. Stay within the scope of the requested transformation.

Example Source format: CSV, Target format: JSON, Field mapping: name -> full_name, Transformation rules: date to YYYY/MM/DD, Language: Python.

Follow-up prompts

  • How can I handle null values during transformation?
  • What is the most efficient way to transform a large CSV file?
  • Can you provide a JavaScript version of this transformation?