Library › Customer Support & Success AI › Revenue operations

Turn account notes into strict JSON with a risk rule

  • For Revenue operations
  • You practice Asking for a format you can use
  • Time about 5 minutes
  • Level Advanced

About this exercise

Return one code block with a JSON array of 4 objects with exactly the keys account, usage_down_pct, sponsor_left and risk. usage_down_pct is the whole-number percent drop (0 if flat, null if unknown). sponsor_left is true or false; it is false when a replacement sponsor has been named. risk is "high" if sponsor_left is true, else "medium" if usage_down_pct is 20 or more, else "low", or "unknown" if usage_down_pct is null. One object per line. No more than 5 words outside the block.

Common mistakes when you ask AI for this

  • Treating Cedar's sponsor as gone. The AI uses the October note and ignores the replacement. Try: Say: "sponsor_left is false when a replacement has been named."
  • Guessing Delta's usage. The AI invents a number or writes 0. Try: Say: "Use null when usage is unknown."
  • Quoting numbers and booleans. The AI writes "25" and "true" as strings. Try: Say: "Numbers and booleans must not be in quotes."
  • Pretty-printing. The AI spreads each object over many lines. Try: Say: "One object per line."
  • Skipping the code block. The AI writes prose around the data instead of one block. Try: Say "return exactly one code block".
  • Talking around the block. The AI adds an intro and notes outside the block. Try: Say "no words outside the block except ...".

What a strong prompt includes

  • Names the four keys
  • States the null and replacement rules
  • Gives the risk rule
  • Keeps it compact
  • Asks for one code block
  • Keeps the block short
  • Limits text outside the block

Practice this now ↑

Related exercises