Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string format - Support for Conditional Replacements #437

Open
arindamghoshal opened this issue Jun 19, 2023 · 0 comments
Open

string format - Support for Conditional Replacements #437

arindamghoshal opened this issue Jun 19, 2023 · 0 comments

Comments

@arindamghoshal
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant