You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I manage metadata for data tables generated from research surveys. Many variables of the data tables are categorical data, so a data value of "1" may represent "Yes". The number of keys and values varies wildly but I simply use strings for both key and value for simplicity (as there are other ways to define if the key/value pairs are numeric, string, etc. using other schema elements). An example of variable/columns with categorical data might be the following (where 'category' represents the data possibilities):
{
"name": "E03PASKR",
"surveyQuestion": "On MOST days of ANY ONE MONTH in the LAST 12 MONTHS did you have pain, aching, or stiffness in any of the following? Please rate as none, mild, moderate, or severe. - Right - Knee",
"label": "Right Knee - pain, aching, or stiffness on MOST days of ANY ONE MONTH in the LAST 12 MONTHS",
"source": "Online survey",
"value": {
"format": "categorical",
"dataType": "Int64",
"unique": "False",
"category": {
"0": "None",
"1": "Mild",
"2": "Moderate",
"3": "Severe",
"888": "No response"
}
}
}
My schema typically looks like:
"category": {
"title": "Categorical variable",
"description": "For categorical variables, this value lists the numeric values and their labels.",
"type": "object",
"patternProperties": {
"^.*$": {
"type": "string"
}
}
}
It would be useful if the jsonschema form would allow a user to create object key/value string pairs of data. This would be similar to how arrays are handled in the form I'm assuming. Validation of patternProperties would likely be a nightmare so I'm not asking for that.
I had thought of splitting out my category keys and values into separate arrays, but I cannot have the keys and values disassociating from one another as they are explicitly linked together, so the possibility of the keys or values getting out of order in the arrays is preventing that approach.
Describe the solution you'd like
Instances of the following would trigger the form to allow the user to add string key/value pairs to a data object. No validation would be triggered. This would be a good starting point for addressing the need for key/value data pairs in the form.
The form elements would function like an array with a new item button at the least (ordering would be nice). Instead on one field per item there would be two with maybe a simple format of the following per item (where the underlines represent data fields):
____________ : ____________
Describe alternatives you've considered
Again, I considered separate key/value arrays for my categorical data but the most important thing is that the key/value pair remain paired together. So separating the pairs into individual arrays can lead to data being mislabeled.
The text was updated successfully, but these errors were encountered:
@kuhlaid Give the highly configurable nature of RJSF, you could create your own custom Field to do what you need. Off the top of my head I'm not quite sure how to go about implementing this. If you run into any issues in doing this, do reach out.
Prerequisites
What theme are you using?
core
Is your feature request related to a problem? Please describe.
I manage metadata for data tables generated from research surveys. Many variables of the data tables are categorical data, so a data value of "1" may represent "Yes". The number of keys and values varies wildly but I simply use strings for both key and value for simplicity (as there are other ways to define if the key/value pairs are numeric, string, etc. using other schema elements). An example of variable/columns with categorical data might be the following (where 'category' represents the data possibilities):
My schema typically looks like:
It would be useful if the jsonschema form would allow a user to create object key/value string pairs of data. This would be similar to how arrays are handled in the form I'm assuming. Validation of patternProperties would likely be a nightmare so I'm not asking for that.
I had thought of splitting out my category keys and values into separate arrays, but I cannot have the keys and values disassociating from one another as they are explicitly linked together, so the possibility of the keys or values getting out of order in the arrays is preventing that approach.
Describe the solution you'd like
Instances of the following would trigger the form to allow the user to add string key/value pairs to a data object. No validation would be triggered. This would be a good starting point for addressing the need for key/value data pairs in the form.
The form elements would function like an array with a new item button at the least (ordering would be nice). Instead on one field per item there would be two with maybe a simple format of the following per item (where the underlines represent data fields):
____________ : ____________
Describe alternatives you've considered
Again, I considered separate key/value arrays for my categorical data but the most important thing is that the key/value pair remain paired together. So separating the pairs into individual arrays can lead to data being mislabeled.
The text was updated successfully, but these errors were encountered: