Back to Blog
Oracle CPQAnti-PatternBMLJSONTechnical

Storing Data as Delimited Strings in Oracle CPQ Cloud :: Anti-Pattern

January 12, 20205 min read

Many consulting companies today offer Oracle CPQ Cloud implementation services. Most of them follow Oracle CPQ Cloud implementation best practices, but sometimes you encounter solutions that seem to work while being fundamentally flawed. One such pattern is storing data as delimited strings.

The Problem with Delimited Strings

Storing data as delimited strings (like door~2|windows~3|color~red) might seem like a quick solution, but it creates numerous problems:

  • You need to parse the whole string every time you want to read or write to it
  • When you have multiple values for a key, it’s hard to understand the mappings
  • If some values contain the keywords, it’s harder to parse
  • If the sequence of the attributes changes, it breaks dependent functionality
  • No value for a key can cause null-pointer exceptions or error out other keys
  • Delimiter present in the string or value causes parsing failures

Common Workarounds (That Don’t Really Work)

Developers often try to patch these issues with workarounds that add even more complexity:

  • Adding new delimiters between pairs: door~2|hasWindows~true
  • Creating unique delimiters: door_-_2***|***hasWindows_-_true
  • Checking for key presence with delimiter: find(delimitedString, "door_-_") > -1

These workarounds make the code harder to read, maintain, and debug. They also introduce new edge cases that need to be handled.

The Solution: Use JSON

Instead of delimited strings, use JSON (JavaScript Object Notation). JSON provides several advantages:

  • Check for existence of the key easily
  • Check for empty or null values without complex string parsing
  • Store complex datatypes like nested objects and arrays
  • Cross-language data as you can reuse it for your frontend JavaScript
  • Cross-platform as you can pass it to other systems
  • Can be stored as a string too when needed

Example in BML

Key Takeaways

When implementing Oracle CPQ Cloud solutions:

  1. Avoid delimited strings for storing structured data
  2. Use JSON for complex data structures
  3. Follow established patterns rather than inventing custom formats
  4. Think about maintainability — the next developer will thank you

By following these best practices, you’ll create more robust, maintainable, and scalable Oracle CPQ Cloud implementations that will serve your organization well into the future.

Need Expert CPQ Help?

Our certified CPQ consultants can help you implement best practices and optimize your quote-to-cash process.

Get in Touch