Which field can I pass json object in DE

I created a data element json file and had pass some object in the style field. When I fetch with the api I see that it is empty. I also checked the database and it is empty. I will like to be able to assign each DE to a section. Which of the DE field can I pass a json object and retrieve it?

Or is it possible to add extra fields to the DE table and retrieve it with the api?

Note that I uploaded the data with the import/export app as a json file.

Hi @jetisco4u ,

when you import the metadata via Import/Export app, only the valid fields are imported and other fields are ignored. Yes, you can add additional properties to the metadata items using attributes.

Thanks,
Rithvik

@rithvik thanks a million times.

1 Like

@rithvik I am importing my DE and the attribute using json file.

Where in the json file do I add the value to import it? Should I capture it inside individual DE object definition or in a separate attribute array?
If in an attribute array what format will it be. In the database I see there is an attributevalue table linked to the attributeid. There is also a dataelementattributevalues which I think would have address my use case but the table does not have columns its empty. So I cant inspect it. But I want a case where the attribute field can have different values for each data element. I will appreciate guidance on how to bulk add values to the DE from the json file or the resource to add it to.

Also if I want to fetch the value of the attributes with the DE how do I reference it in the api params fields?

Below is an example of my DE definition. I remove some part.

        {
            "code": "DE_1",
            "name": "General Attendance",
            "publicAccess": "rw-r-----",
            "categoryCombo": {},
            "sharing": {
                "public": "rw-r----",
                "users": {}
            }
        },

EDITED
I figure out from the export file that they are added to the attributeValues field as an array like below


                    "attributeValues": [
                        {
                            "value": "FHaQMPv9zc7",
                            "attribute": {
                                "id": "uwVkIP7PZDt"
                            }
                        },
                        {
                            "value": "res.value = parseInt(res.value);",
                            "attribute": {
                                "id": "FHaQMPv9zc7"
                            }
                        }
                    ]

It would have fully serve my need if the response is listed as an array of object instead of a nested array. For example like below id and name where id is the attribute id since they are unique.


                    "attributeValues": [
                        {
                            "id": "uwVkIP7PZDt",
                            "name": "something 1",
                            "value": "FHaQMPv9zc7"
                        },
                        {
                            "id": "FHaQMPv9zc7",
                            "name": "something 2",
                            "value": "res.value = parseInt(res.value);",
                        }
                    ]