GoZync

Tips for Field Mapping Scripts

GoZync.FieldMapping History

Hide minor edits - Show changes to output

November 21, 2016, at 05:33 PM by KC Embrey - Created Troubleshooting Anchor
Added line 64:
[[#Troubleshooting]]
Changed line 69 from:
Upload a single from Mobile to GoZyncConnector (you can even do this in FileMaker Pro, instead of Go) and then try to process that 1 record from the [[TheInbox | Inbox]] in GoZyncConnector. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:
to:
Upload a single from Mobile to GoZyncConnector (you can even do this in FileMaker Pro, instead of Go) and then try to process that 1 record from the [[TheInbox | Inbox]] in GoZyncConnector. If it fails, you'll see the first Filemaker error reported right in the record's row in Inbox. Here are come common errors:
June 28, 2011, at 03:17 AM by 76.22.74.86 -
Changed lines 1-2 from:
(:title Tips for Field Mapping:)
to:
(:title Tips for Field Mapping Scripts:)
May 22, 2011, at 09:36 PM by 76.22.74.86 -
Changed lines 62-63 from:
> > More
to:
Coming Soon.
May 22, 2011, at 04:34 PM by 76.22.74.86 -
Added lines 29-37:
!! Forcing Lookups

There may be times when lookup data doesn't fill in when you process records. This can happen when you're [[splitting records]] and the record (a customer, for example) hasn't been committed as FileMaker tries to lookup their information in a related record like an invoice.

This is a side effect of making ''all'' of GoZync transactional and you may want to back off this a bit, especially when it is the FileMaker-to-FileMaker communication of processing records in the InBox. "Backing off" in this case means adding a commit records script step to make sure you commit a record (like a customer) before using their information in a lookup.

To do this in any "Set XXXX Field" script, add the commit records script step right before the comment "Cleaning Up". In our customer-and-invoices example, where the customer data might not be getting looked up into the invoice, you'd add this in the "Set Customer Fields" script to commit the customer record.

May 22, 2011, at 03:46 PM by 76.22.74.86 -
Changed lines 23-30 from:
!! Splitting Tables

You have a a very simple mobile file with only one or two tables (something a database designer would call a fairly "flat" file
), while your served solution may us many tables to represent the same data (it may be more "relational"). Go Zync provides a method for splitting the data from one table into many tables. Though this is most often done on the served side, you can split tables coming down onto the device as well.

For an example of how this works, check out the "Set Invoice Fields" script in a clean copy of GoZyncConnector. The scenario here is that our mobile file keeps the invoiced contact and their address IN the invoice table, while our sample served solution (Invoices.fp7) has a separate customer table. So you'll find a piece of GoZyncConnector's "Set Invoice Fields" script where we leave the invoice, create a customer record, and return to use the newly created customer ID in our invoice. This happens between the comment "Splitting Tables..." and "...End Splitting Tables".

Notice that we can create additional "Set XXXX Fields" scripts, for entities that don't exist in our mobile file: the Data Dictionary form our mobile file didn't mention a customers table, because the mobile file didn't have one, but we can still create a "Set Customer Fields" script in GoZyncConnector and split the invoice data into an invoice record and a related customer record.

to:
(:include SplittingRecords:)
May 17, 2011, at 11:38 PM by 76.22.74.86 -
Changed lines 37-38 from:
> > Ask todd
to:
> > In serialize,

Am I a container field…

If it is a container

In the text, we put <attachment> attachment number </attachment>\

We then put these into the same repetition in inbox.

Repeating field has the container.

When unpacking

If there is  <attachment> attachment number </attachment> in our document content we grab that rep from the repeytion in in box.

So as I'm building a mapping layout I do[n't need to worry about images.

It may be that what I did by hand is something we need to bring into unpack.

May 17, 2011, at 01:31 AM by 76.22.74.86 -
Added lines 35-38:
!! Working with Photos

> > Ask todd

May 17, 2011, at 12:49 AM by 76.22.74.86 -
Added lines 5-8:
When you're editing the "Set XXXX Fields" scripts in GoZyncConnector or in your mobile file, you're mapping the data sent in a [[TheDocument | document]] to the real fields in your table.

The data you have to work with has, by this point, been unpacked into one $variable for every field name in your source table. Well not "every" field name, of course, just those included on the tabs of your source's Field Mapping layout. (If you're sending data up to your server form mobile, your source table is the table and field names in your mobile file.)

May 17, 2011, at 12:22 AM by 76.22.74.86 -
Changed lines 7-8 from:
!! Making your Field Mapping easier
to:
(:include TheDataDictionary:)
May 17, 2011, at 12:21 AM by 76.22.74.86 -
May 17, 2011, at 12:19 AM by 76.22.74.86 -
Changed line 43 from:
-> • Good post but error anyway: set a calc etc.
to:
-> • You may have situations where an inbox record is posted to your file correctly, but you see an error  anyway. This is likely because one of the fields you've mapped to in one of your "Set XXXX Fields" is a calc. Our script only traps the first set field statement to make sure the record is editable, subsequent set field statements aren't error trapped so they aren't invisible, Failing loudly should help you debug them.
May 16, 2011, at 11:57 PM by 76.22.74.86 -
Changed lines 25-26 from:
Notice that we can create additional "Set XXXX Fields" scripts, for entities that don't exist in our mobile file: the [[Data
to:
Notice that we can create additional "Set XXXX Fields" scripts, for entities that don't exist in our mobile file: the Data Dictionary form our mobile file didn't mention a customers table, because the mobile file didn't have one, but we can still create a "Set Customer Fields" script in GoZyncConnector and split the invoice data into an invoice record and a related customer record.
May 16, 2011, at 11:52 PM by 76.22.74.86 -
Changed lines 41-43 from:
--> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacking section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.

--> • Good post but error anyway: set a calc etc.
to:
-> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacking section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.

-> • Good post but error anyway: set a calc etc.
May 16, 2011, at 11:52 PM by 76.22.74.86 -
Changed lines 21-26 from:
to:
You have a a very simple mobile file with only one or two tables (something a database designer would call a fairly "flat" file), while your served solution may us many tables to represent the same data (it may be more "relational"). Go Zync provides a method for splitting the data from one table into many tables. Though this is most often done on the served side, you can split tables coming down onto the device as well.

For an example of how this works, check out the "Set Invoice Fields" script in a clean copy of GoZyncConnector. The scenario here is that our mobile file keeps the invoiced contact and their address IN the invoice table, while our sample served solution (Invoices.fp7) has a separate customer table. So you'll find a piece of GoZyncConnector's "Set Invoice Fields" script where we leave the invoice, create a customer record, and return to use the newly created customer ID in our invoice. This happens between the comment "Splitting Tables..." and "...End Splitting Tables".

Notice that we can create additional "Set XXXX Fields" scripts, for entities that don't exist in our mobile file: the [[Data

May 16, 2011, at 11:07 PM by 76.22.74.86 -
Changed lines 13-14 from:
-> Remember that you don't have to simply send the $variable data from the mobile file into your database as is: you can perform calculations and transformation on the data in your "Set XXX Field" scripts. Here is a simple example..,
to:
Remember that you don't have to simply send the $variable data from the mobile file into your database as is: you can perform calculations and transformation on the data in your "Set XXX Field" scripts. Here is a simple example..,
Changed lines 17-18 from:
-> Transformations like these are one of the real strengths of GoZync in that they allow you to build mobile files that have a completely different structure from your served files. "Splitting Tables", below, is another popular transformation.
to:
Transformations like these are one of the real strengths of GoZync in that they allow you to build mobile files that have a completely different structure from your served files. "Splitting Tables", below, is another popular transformation.
Changed lines 34-35 from:
-> Upload a single from Mobile to GoZyncConnector (you can even do this in FileMaker Pro, instead of Go) and then try to process that 1 record from the [[TheInbox | Inbox]] in GoZyncConnector. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:
to:
Upload a single from Mobile to GoZyncConnector (you can even do this in FileMaker Pro, instead of Go) and then try to process that 1 record from the [[TheInbox | Inbox]] in GoZyncConnector. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:
May 16, 2011, at 11:07 PM by 76.22.74.86 -
Changed lines 7-8 from:
!! Making your Field Mapping simpler
to:
!! Making your Field Mapping easier
Added lines 11-21:
!! "Transforming" Data

-> Remember that you don't have to simply send the $variable data from the mobile file into your database as is: you can perform calculations and transformation on the data in your "Set XXX Field" scripts. Here is a simple example..,

-> Let's say your local field has two fields for a contact's name, NameFirst and NameLast, but your served database has only one: FullName. You could set FullName to this: $NameFirst & " " & $NameLast.

-> Transformations like these are one of the real strengths of GoZync in that they allow you to build mobile files that have a completely different structure from your served files. "Splitting Tables", below, is another popular transformation.

!! Splitting Tables

Changed lines 34-38 from:
Upload a single from Mobile to GoZyncConnector (you can even do this in FileMaker Pro, instead of Go) and then try to process that 1 record from the [[TheInbox | Inbox]] in GoZyncConnector. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:

-> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacking section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.

-> • Good post but error anyway: set a calc etc.
to:
-> Upload a single from Mobile to GoZyncConnector (you can even do this in FileMaker Pro, instead of Go) and then try to process that 1 record from the [[TheInbox | Inbox]] in GoZyncConnector. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:

--> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacking section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.

--> • Good post but error anyway: set a calc etc.
May 16, 2011, at 08:52 PM by 166.205.141.213 -
Changed lines 25-26 from:
-> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacing section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.
to:
-> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacking section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.
May 16, 2011, at 08:51 PM by 166.205.141.213 -
Changed lines 23-24 from:
Send a record from Mobile to GoZyncController (you can even do this in FileMaker Pro, instead of Go) and then try to process 1 record. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:
to:
Upload a single from Mobile to GoZyncConnector (you can even do this in FileMaker Pro, instead of Go) and then try to process that 1 record from the [[TheInbox | Inbox]] in GoZyncConnector. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:
May 16, 2011, at 08:50 PM by 166.205.141.213 -
Changed lines 3-6 from:
! Overview

!! What field mapping does

to:
!! Overview
May 16, 2011, at 08:50 PM by 166.205.141.213 -
Added lines 3-12:
! Overview

!! What field mapping does

! Using a Dictionary

!! Making your Field Mapping simpler

! Tips & Tricks

April 14, 2011, at 03:55 PM by 76.22.74.86 -
Added line 18:
April 14, 2011, at 03:55 PM by 76.22.74.86 -
Changed lines 17-18 from:
-> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacing section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.
to:
-> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacing section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.
-> • Good post but error anyway: set a calc etc
.
April 14, 2011, at 02:35 PM by 76.22.74.86 -
Changed line 17 from:
• Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacing section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.
to:
-> • Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacing section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.
April 14, 2011, at 02:35 PM by 76.22.74.86 -
Added lines 1-17:
(:title Tips for Field Mapping:)

!! Handling Related Records

> > Notes about saving the IDs of newly created parent records so you can make their children

!! More

> > More

! Troubleshooting Your Mapping

!! Common problems

Send a record from Mobile to GoZyncController (you can even do this in FileMaker Pro, instead of Go) and then try to process 1 record. If it fails, you'll see the first FIleMaker error reported right in the record's row in Inbox. Here are come common errors:

• Record is Missing. This is most likely because one or more of your table occurrences in the Packing and UnPacing section of the relationship graph in Connector do not have "Allow creation of records in this table..." checked. This needs to be "on" for each tale on your file's side of the relationship.
(855) SEEDCODE
[email protected]
Follow us: