Skip to content

string format - Support for Conditional Replacements #437

Open

Description

@arindamghoshal

Required Functionality
Construct string values based on conditional replacements as part parsing a parametric format string

Proposed Solution
Support for Ternary conditional operator as part of parametric format string. Something like this -

"productId": {
  "type": "string",
  "format": {
    "format": "{productType}_{IF({productType}=='alphabet', {alphabets}, {digits})}",
    "arguments": {
      "productType": {
        "type": "string",
        "categorical": {
          "alphabet": 1,
          "digit": 1 
        }
      },
      "alphabets": {
        "type": "string",
        "categorical": {
          "abc": 3,
          "def": 5,
          "ghi": 2
        }
      },
      "digits": {
        "type": "string",
        "categorical": {
          "123": 3,
          "456": 5,
          "789": 2
        }
      }
    }
  }
}

I have use a function like construct IF(condition, trueValue, falseValue) only to explain the intent.

Use case
String based Identify values are quite complex and ability to generate variations based on the value of another dynamic value would make the declarative data model robust.

Activity

  1. rkazanova commented on Aug 27, 2025

    @rkazanova

    I found that there is no possibility to use conditions, but it will be good
    seems project is dead btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions