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

Add "required" field for tag results in exported data #6036

Open
shisaru292 opened this issue Jun 27, 2024 · 1 comment
Open

Add "required" field for tag results in exported data #6036

shisaru292 opened this issue Jun 27, 2024 · 1 comment

Comments

@shisaru292
Copy link

shisaru292 commented Jun 27, 2024

Is your feature request related to a problem? Please describe.
I use one template with different "required" settings of tags for different projects. This is designed to reduce the burden of tagging tasks and to give different emphasis each time. But when I analyze the results, I need to distinguish whether a certain tag is required or not, such as filtering the post processed results with elasticsearch.

Describe the solution you'd like

# FROM
"result": [
    {
        "value": {
            "choices": [
                "No"
            ]
        },
        "id": "8264eY7_8D",
        "from_name": "_1003",
        "to_name": "dialogue_html",
        "type": "choices",
        "origin": "manual"
    },
    ...
]

# TO
"result": [
    {
        "value": {
            "choices": [
                "No"
            ]
        },
        "id": "8264eY7_8D",
        "from_name": "_1003",
        "to_name": "dialogue_html",
        "type": "choices",
        "origin": "manual",
        "required": false  // add this new field
    },
    ...
]

Describe alternatives you've considered
I have considerd put the information into "from_name" for now, wihch is the name of a tag like Choices. For example when I generate the template for a new project, I might be able to:

if item.get("required", False):
        name = name + "_r" # r for required
    else:
        name = name + "_o" # o for optional

But such code with pre and post process looks very ...irregular. And what's more, old projects cannot add the information with updating the new generated template directly.

Consider more, "required" information is only one of many meta-information. Perhaps a more flexible string array of meta information could be used to augment such information?

Additional context
No

@shisaru292
Copy link
Author

shisaru292 commented Jun 27, 2024

Another alternative now im using is to request label_config XML through the project read API (api/projects/1/?include=id%2Ctitle%2Clabel_config) and get the "required" settings before processing and storing the exported data (e.g. via api/projects/1/export) into analytics engine.

@shisaru292 shisaru292 changed the title Adds "required" information for tag values in exported data Add "required" field for tag results in exported data Jun 28, 2024
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