← Back to team overview

dhis2-devs team mailing list archive

Issue with custom attributes in data set api

 

Hi Morten,

We have created an attribute called "isPrintable" with a value type - "Yes
Only" and assigned it to data set and program. We have few clarifications
on the below api
*
/api/dataSets.json?fields=id,name,attributeValues[:all,value,name,attribute[id,name,code]]*


   - Immediately after assigning the attribute to data set and program, we
   invoked the api. The api is not showing the attribute as part of the
   response as it is still 'unchecked' in the data set page of maintenance
   app. The attribute array is empty in the response.
   - Now we marked that attribute is 'checked' in the data set page of
   maintenance app. The api is returning the attribute value as 'true' which
   is fine.  But when the attribute is 'unchecked' in the app, the api is
   returning the value as 'false'. Should it not show up in the response as it
   was in the first case? Is it expected behaviour? If so what is the
   difference between "Yes Only" and "Yes No" attribute types?
   - Now we edited that attribute and unassigned it from data set and
   program. But the data set api is still showing the attribute in its
   response. It should not come up in the response right?

Could you please provide inputs for the same.

Thanks
Aamer.

Follow ups