← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] Recursive filters not working in the DHIS2 web API

 

Hi Gaurav

This was change quite some time back. The default filter operator is now
AND, which means that query will not work. You have 2 options:

https:/
serverurl.org/api/26/dataElementGroups.json?filter=dataElements.id:in:[ID1,ID2]

or

https:/
serverurl.org/api/26/dataElementGroups.json?filter=dataElements.id:eq:ID1&filter=dataElements.id:eq:ID2&rootJunction=OR

https://docs.dhis2.org/master/en/developer/html/webapi_metadata_object_filter.html
https://docs.dhis2.org/master/en/developer/html/webapi_metadata_object_filter.html#webapi_metadata_logical_operator


-- 
Morten Olav Hansen
Senior Engineer, DHIS 2
University of Oslo
http://www.dhis2.org

On Thu, Jul 6, 2017 at 8:52 PM, Gaurav Kumar <
gkumar@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> Hi Devs,
>
>
>
> We recently upgraded to DHIS2.26, and I have recently found that recursive
> filters are no longer working in the WEB API. To make sure that this was
> just not our revision that has this bug, I also tested on the DHIS2 latest
> stable demo site and there also I saw the same behavior.
>
>
>
> To clarify more; queries in the following format: https:/
> serverurl.org/api/26/dataElementGroups.json?filter=dataElements.id:eq:ID1
> &filter=dataElements.id:eq:ID2 , returns an empty list though I checked
> and found that more than one DE-groups with the queried DEs exist. I tried
> this with other resources as well but encountered the same issue.
>
>
>
> I also checked the 2.26 and 2.28 documentation to check if there has been
> a change in the query format but the manuals still specify that same. So I
> am wondering if this is a bug or the documents are not updated.
>
>
>
> As this is affecting a critical module of ours, any prompt help will be
> highly appreciated.
>
>
>
> Regards,
>
>
>
> GAURAV
>
> Technical Consultant
>
> International Medical Corps
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References