Trent Warrick Posted November 3, 2014 Posted November 3, 2014 Hello again! my databases have been operating very well for the past two months! I do have a question now, is it possible to only sync down data that matches a certain criterion? The situation is this, I have 10 stores testing out this database and I want my master server to accept data from all of them but only sync back down their data (in the event that I send them a new file, or they get a new ipad), i've attached a diagram of sorts. I have three ipads at one location that i have setup doing a full sync to a server, and i have the other locations that dont sync at all, but now when i am wanting to update their database, I have no way of getting their data, Is it possible to have different sync settings based on the value in a cell? photo of cell is also attached Any help would be greatly appreciated!
bcooney Posted November 3, 2014 Posted November 3, 2014 there is a 12th parameter that is passed to the Prepare Payload for Client script from the Pull Payload script, $additional_pull_info. If you modify the script step that sets $dyn_sql to include this in the WHERE clause, then you can "filter" which records are included in the payload.
timdietrich Posted November 4, 2014 Posted November 4, 2014 Trent -- Another option is to use the ES_Exclude field, which can be used to filter the records that are synced based on your business rules. You can find info about this here: http://fmeasysync.com/docs-easysync-integration/ (See "Can I use EasySync to sync specific records based on business rules?") -- Tim
bcooney Posted November 4, 2014 Posted November 4, 2014 Tim- Would changing ES_Exclude to an unstored calc incur a performance hit, though? And, if I wanted to pass a value for use in that calc, what would be the best method? Use $additional_settings in the ES_Exclude calc? -Barbara
timdietrich Posted November 4, 2014 Posted November 4, 2014 Barbara -- Yes, using an unstored calc might cause a performance hit. It depends on the number of records, complexity of the calc, etc. But it is the easiest way to filter records. $$additional_pull_info provides a way to send extra info during the pull process, and you can use it for filtering purposes (either in the calc for the ES_Exclude field or in the SELECT statement), or anything else that you want to do with it (logging, etc). However, if the filtering is being done based on account names or prig sets, you can always use functions like Get ( AccountName ) or Get ( AccountPrivilegeSetName ) instead. So you have a lot of options. -- Tim
bcooney Posted November 4, 2014 Posted November 4, 2014 Thanks, Tim. No, we "filter" records by an organization_id. What is the purpose of the ES_Account field? Our iPad users all login with the same FM account.
Suzie2 Posted December 5, 2014 Posted December 5, 2014 I am also trying to achieve the same thing where I want to filter down records depending on which device id is calling the sync. I want to use the prepare payload for client script - or the exclude. I am trying to filter records from the hosted file to client file while syncing based on which client device id is syncing. So I am trying to do this in the prepare payload for client script in the Hosted File database.I This is where I need to add my business rule, but am not sure how to manipulate the dyn sql variable there to include this business rule. I would like to check if the sync table is a particular table and if a particular client device is doing this sync and if that particular sync table has a field set to some value then that record should be pulled down. Otherwise not. Please advise on how I would achieve this....
siroos12 Posted February 16, 2016 Posted February 16, 2016 On 11/3/2014 at 0:22 AM, bcooney said: there is a 12th parameter that is passed to the Prepare Payload for Client script from the Pull Payload script, $additional_pull_info. If you modify the script step that sets $dyn_sql to include this in the WHERE clause, then you can "filter" which records are included in the payload. bcoony, Would you please elaborate this a bit more? I have no knowledge of SQL. Actually what I need is to conditionally sync back from the server to Ipad. I don't want Ipad users to be able to see other users records. I was thinking if I can modify the WHERE clause, somehow, to only push those records with the same "account name" as the Ipad user account name. So this way, when an Ipad user syncs, he/she will only receive his/her records which have been modified on server since last sync. Hope this does make sense at all. Regards, Siroos
Recommended Posts
This topic is 3271 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now