Case Filter Handling

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
arkagwa
Posts: 98
Joined: November 18th, 2014, 5:25 am

Case Filter Handling

Postby arkagwa » June 22nd, 2017, 1:22 am

Dear Josh

I have managed to connect and use Dropbox sync successful. Now kindly help on how to stop interviewer to edit data which is NOT his or her. After sync all data from server are loaded into device of the interviewer

josh
Posts: 1680
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Case Filter Handling

Postby josh » June 22nd, 2017, 7:58 am

There are three options. You could use PUT instead of BOTH as the sync direction (in sync options dialog choose "upload changes to server") in which case the interviewer will not download data from the server. That is the easiest option.

The second option is to use a universe when you sync. That lets you limit the cases that are uploaded/downloaded based on the case ids. For that you would need to use sync logic functions in a menu program so it is a bit complicated. You can look at the Synchronization from Logic example of how to use sync functions in a menu program. The help for syncdata() explains how to add a universe.

Third option is to use CaseListingFilter in your pff file to limit the cases shown to the interviewer. This still downloads everything to the tablet but only shows the interviewer those that match the filter. See "Run Production Data Entry" in the help for details on CaseListingFilter.

kompiler
Posts: 24
Joined: January 25th, 2017, 12:38 pm

Re: Case Filter Handling

Postby kompiler » March 19th, 2018, 8:56 am

Dear josh,

Could you please give an example of using CaseListingFilter in pff file. my case id consist of district id, village id and household number. in separate item i am capturing interview id (which is not part of case id). is it possible to filter data by interviewer id? could you please provide a regular expression that would filter data by district (case id = district id (len=1) + village id (len=2) + household number (len=3), all data types are number) .

Regards,
Komil

josh
Posts: 1680
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Case Filter Handling

Postby josh » March 19th, 2018, 7:40 pm

You can only use id-items in the case listing filter so you can't use the interview id variable in it.

If you want to filter based on the id-items you would set the case listing filter to the concatenation of the id's you want to show. For example if you want to only show district=1, village=22, household number=333 then you would use:

CaseListingFilter=122333

If instead you wanted to show all households in district=1, village=22 then you could use:

CaseListingFilter=122.*

kompiler
Posts: 24
Joined: January 25th, 2017, 12:38 pm

Re: Case Filter Handling

Postby kompiler » March 19th, 2018, 11:43 pm

Dear josh,

Thank you so much for clarification.


Return to “Synchronization”