Set Field Transformations
GoZync3.SetFieldTransformations History
Hide minor edits - Show changes to markup
The fields on your mobile and hosted files may be different. They may have different names or need to contain really different data.
The fields on your mobile and hosted files may be different. They may have different names, or need to contain different data.
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 take that into account in your calc.
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 ) ) )
)
Add an ElseIf for each field name you want to manipulate, and then end with an Else setting the $fieldname to the untransformed $fieldValue.
You can do this in both GoZyncMobile and GoZyncHosted.
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 take that into account in your calc.
You can do this in the SetField script in both GoZyncMobile and GoZyncHosted.
Rather than putting the name in quotes as in our screen shot, wrap it in the GetFieldName() function 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.
You can do this in both GoZyncMobile and GoZyncHosted,
You can do this in both GoZyncMobile and GoZyncHosted.
Rather than putting the name in quotes as in our screen shot, wrap it in the GetFieldName() function like this:
sasffasf
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:
Add an ElseIf for each field name you want to manipulate, and then end with an Else setting the $fieldname to the untransformed $fieldValue.
You can do this in both GoZyncMobile and GoZyncHosted,
Enjoy!
[http://www.seedcode.com/rootimages/stikipad/gozync/SetFields1.png
http://www.seedcode.com/rootimages/stikipad/gozync/SetFields1.png
http://www.seedcode.com/rootimages/stikipad/gozync/SetFields1.png
[http://www.seedcode.com/rootimages/stikipad/gozync/SetFields1.png
http://www.seedcode.com/rootimages/stikipad/gozync/SetFields2.png
http://www.seedcode.com/rootimages/stikipad/gozync/SetFields2.png
http://www.seedcode.com/rootimages/stikipad/gozync/SetFields1.png
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.
http://www.seedcode.com/rootimages/stikipad/gozync/SetFields2.png
sasffasf
=)
Overview.
The fields on your mobile and hosted files may be different. They may have different names or need to contain really 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.
Getting in between GoZync and your data: changing our SetField script
=)