exporting related records to csv
Returning to the question of creating a CSV file with names and associated contact data (for import to other apps) (address book, google, etc) This is not, I think, complicated only tedious. Just doing a gut check on my strategy, and wondering if there is a better way. Thanks for any insights.
Situation (simplified a bit) has two related tables:
A: names and related singular data (names, address, company, title)
B: Contact points linked by a kUID. Table B has two fields: Type label (ie work phone, email personal, etc) and Data (number, address, etc). The label is chosen from a Type value list of about 15 options.
I understand how to create a layout based on table B, with data from A being repeated on different rows, but I am unsure that solves a problem of how to Map the variously labeled fields in the export/import process.
I can envision a script to
- create variables: IF (lable = "work number"; set variable [$work=<phonefield>) ELSE IF (lable=$home; set ... etc etc.
- move to a new table with a separate field for every variable iteration, and other data from Table A, and use look ups and SetFieldByName to create new records. The way I see it I'll still have multiple records for each UID, but data will be in specific fields (columns).
How do I loop through the original layout / found set?
Is there a way that will create a single record (row) with all the data related to one UID in it's proper field?