Custom Field Mapping
These are the notes for GoZync 3. Docs for the latest version of GoZync--GoZync 4--can be found here. GoZync 4 is a free upgrade and is highly recommended (hint: it's faster).
Overview
Note. Custom field mapping is not available in LowZync, the free version of GoZync.
If the field and table names in your mobile and hosted files match, GoZync will move the data between them automatically. If the field names are the same, but your table occurrence names are different, you identify that during the integration when you select your table occurrence names in GoZyncHosted. So the only time you need to get into custom mappings is when the field names in your mobile file and those in your hosted file differ.
Creating a field mapping.
From the dashboard, select the layout you're interested in and click "Integration & Options", then proceed to integration. You'll need all your files open: GoZyncHosted, GoZyncMobile, your mobile file and your hosted solution.
(Visit the downloads tab of GoZyncHosted to pull down copies of the mobile files, providing they are up to date.)
Now click the "Field Mapping (optional)" tab and you'll see the table occurrences represented on your layout to the left. Select each one and create field mapping for any fields whose names don't match.
Repeating Fields
GoZync syncs repeating fields without issue, but if your names differ, you'll need to create a custom field mapping for each repetition of the field. As shown here for "date" and "orderdate":
You'll also want to make sure that all the repetitions you wish to sync are on the layout used for Zyncing. For example, if you show repetitions 1 and 3, those are the only ones that will be Zynced.
Seeing Errors?
Learn more: Processing Errors
You can also transform the data itself, editing our SetField routines to change what gets written into your solution, or where that data goes...
Set Field Transformations
These are the notes for GoZync 3. Docs for the latest version of GoZync--GoZync 4--can be found here. GoZync 4 is a free upgrade and is highly recommended (hint: it's faster).
Getting in between GoZync and your data: changing our SetField script
Overview.
The fields on your mobile and hosted files may be different. They may have different names, or need to contain different data.
If the only thing you need to deal with is that your fields have different names, you can handle that in the custom field mapping section of GoZync's integration.
If, however, you need to change the data from one side to the other (like merging first and last names into a full name, or changing date formats) the instructions below are for you.
Editing our Set Field Scripts.
You'll find a script called "Set Fields" in both GoZyncHosted and GoZyncMobile. This is the script that actually moves the data from our synced "package" into your fields. This is done with a single SetFieldByName script step shown in blue below.
In order to transform the contents of a field during the sync, you'll replace this line with a few IF statements and calcs. The final result is shown below. After the screen shot we'll walk you through making this change.
The first thing to do is copy the calc part of that SetFieldByName step (the long let statement that gets the field value) and set that to a variable called $fieldValue. You'll see that as the first line in blue in the screen shot above.
Then create an If statement for each field you'd like to transform, testing the field name. Remember this is the field name in the mobile / hosted side you're working on. So if you're editing this script in GoZyncMobile, you're looking for the name of your Mobile field.
And the field name here is the full field name, like this:
Rather than putting the name in quotes as in our screen shot, wrap it in the GetFieldName() function like this...
...as that will protect you if you ever change the way "LastName" is spelled in field definitions.
Add an ElseIf for each field name you want to manipulate, and then end with an Else setting the $fieldname to the untransformed $fieldValue. When you're transforming, remember that $fieldValue will sometimes be blank, so you might use a calc like this if you were transforming dates:
Let ( [
t = $fieldValue ; sp = Substitute ( t ; "/" ; "¶" )
] ;
if ( isempty ( t ) ; "" ; Date ( GetValue ( sp ; 2 ) ; GetValue ( sp ; 1 ) ; GetValue ( sp ; 3 ) ) )
)
You can do this in the SetField script in both GoZyncMobile and GoZyncHosted.
Enjoy!