Load Data

Description

Loads a row of data from a spreadsheet file into tags or objects.

Fuga can load data from spreadsheet files that are saved in CSV or Excel format (see the topic article on Spreadsheets for more information).

The data loaded can consist of text or placeable files (normally an image). A placeable file in the spreadsheet is referenced by its file path, relative file path, file name, or even partial file name. You can tell Fuga where to look for the files using the Image tab. When attempting to load data into a text frame, Fuga will assume that the data is text, and when attempting to load into an image frame Fuga will assume it’s a placeable file.

You can place multiple images based on one string by giving multiple graphic frames in a selection the same tag or name, and then using a naming mechanism in conjunction with the Image tab parameters to locate multiple associated images. For more information, see the Image Tab description.

For more on how Fuga works with spreadsheet files, see the article Working With Data in Fuga, and the Automating with Fuga tutorial series.

Works On
The Load Data action can load data into tags or object names.  When loading data into object names, the Load Data action works on selected objects with names corresponding to column names in the spreadsheet. When loading data into tags, the Load Data action works on tags within selected objects and also within objects in the selected Super Group (i.e., the objects with the tags don’t need to be selected, just their parent Super Group does, which is different from loading data into objects by name).
Changes Selection?
This action does not change the selection.

Location

The Load Data action is located in the Fuga Workshop panel under the Data actions category.

Examples

Loading Data from a Single Row into XML Tags

In this example, the first row of data is loaded from a spreadsheet file into the document. Here Fuga knows which column to load into which tag based on the fact that they have identical names. When column names don’t match the tag or object names exactly, you can specify what to link to what using the mapping tab (which is used in a later example).

This example uses the absolute path of the spreadsheet file, and the relative path of the images files to tell Fuga where they’re located, however there are other options for how to specify where files are located. For more on how this works, see the topic article File Paths.

Similar parameters are used for loading data into objects by their object names. The main difference is that instead of giving objects tags that match column names, you give them object names that match the column names.  The downfall of using that method, however, is that only one name can be applied to an object, and Fuga can only replace all of the text within a frame, as opposed to only part of it.

Action Setup

Action Results

Loading Data from Multiple Rows of a Spreadsheet

To load data from multiple rows in CSV, use the Load Data action with a Data Rows loop. For a more complete guide to loading multiple rows of data, and a general introduction to many important concepts in Fuga, check out the Automating with Fuga tutorial series.

Modifying Which Columns are Loaded into Which Tags

When your tags match your column names exactly, Fuga automatically knows which columns to load into which tags. When you need more control, however, over which columns to load into which tags, use the Mapping tab of the Load Data action.  Mapping is all or nothing, so if you map one tag to one column, you need to map all the ones you wish to load data into.

Parameters

The Load Data action’s parameters can be found on both the File, Mapping, Image, and Text tabs in the Load Data action’s parameter area.

The parameters under the File tab specify where to find the data file and where to load the data into. The parameters under the mapping tab specify which column is loaded into which tag or object. The parameters under the images and text tabs specify how images and text should be loaded.

File Location Parameters

These parameters help tell Fuga where to find the spreadsheet file. For more information, see the article on File Paths.

Path Field
(string) The absolute path, relative path, or file name for the spreadsheet file. 

  • If the Absolute Path option is selected from the Directory Options drop-down: The Path field contains the absolute path of the CSV or Excel file (e.g., “C:Documents:My Project:Spreadsheets:MyProjectData.xls”). To easily locate the absolute path, press the “…” button on the right hand side of the field to browse files.
  • If one of the Relative To options is selected from the Directory Options drop-down: The Path field contains the path relative to the directory. If the file is located in the top-level of the directory, this will be the file name (e.g., “MyProjectData.xls”). If the file is in a sub-folder of the directory this will be the name of the sub-folder or sub-folders plus the file name (e.g., “Spreadsheets:MyProjectData.xls”).
Directory Location Drop-Down
Tells Fuga where to look for the spreadsheet file. You must set each of these directories except for the current document directory using the Set Directory action

  • Absolute Path – Default. Specifies that the Directory field contains the absolute path of the spreadsheet.
  • Relative to Global Directory – Searches for the spreadsheet file in the global directory as set using the Set Directory action.
  • Relative to Current Document – Searches for the spreadsheet file in the directory that the current InDesign document is located in, unless the current document directory has been changed using the Set Directory action. The document must be saved to use this option or an error will be raised.
  • Relative to Database Directory – Searches for the spreadsheet file in the database directory as specified using the Set Directory action.
  • Relative to Images Directory – Searches for the spreadsheet file in the images directory as specified using the Set Directory action.
  • Relative to innd Files Directory – Searches for the spreadsheet file in the InDesign documents directory as specified using the Set Directory action.
  • Relative to Logo Directory – Searches for the spreadsheet file in the logo directory as specified using the Set Directory action.
  • Relative to Output Directory – Searches in the spreadsheet file in the output directory as specified using the Set Directory action.

Additional File Tab Parameters

Row Number Field
(number) The row number for the row of data to load. Row 0 contains the column names, so using 1 will load the first row of data.
Load Into Drop-down
Specifies what to load data into. When multiple text frames are found with the same tag or object name, Fuga will load the corresponding text into all of them. When there are multiple graphic frames selected with the same tag or object name, Fuga will attempt to place all image files located using the string in the associated column and leave the rest empty. 

  • Fuga Objects – Loads data into objects based on their object name as assigned in the Fuga Object panel. This replaces all the objects’ content. For this to work, each object must be selected (as opposed to within the selected Super Group, as is the case with loading into XML tags).
  • XML Tags – Default. Loads data into XML tags. Data can be loaded into tags within objects inside a selected Super Group (i.e., the objects themselves don’t necessarily have to be selected).

Mapping Tab

These parameters assign Fuga object names or XML tags to columns within a spreadsheet. If the object names or the XML tags are case-sensitive matches to the column names, it is not necessary to map the tags/object names to columns. If you also don’t want to load all the tags/objects which have matching column names, you can use this tab to map the ones that you do want to load into and Fuga will ignore the rest. This means though that if you map anything, you must map everything that you wish to load data into.

Tag/Object Name Column
(string) The XML tag or object name corresponding to the adjacent column name. To insert a new XML tag or object name press the + button on the right side of the table. To delete one, select it and press the x on the right side of the table. Always remember to put quotes around tags and object names, since they’re strings.
Column Name Column
(string) The name of the column to load into the adjacent XML tag or object. Always remember to put quotes around column names, since they’re strings.

Image Tab

These parameters are used to specify how to load images or other placeable files into graphic frames, and how Fuga should use the string from the spreadsheet to find the image.

You can place multiple images based on one string by giving multiple graphic frames in a selection the same tag or name, and then using a naming mechanism in conjunction with the Image tab parameters to locate multiple associated images. For example, if you want to find multiple images of the person, John Walker, save your files as JohnWalker1.jpg, JohnWalker2.jpg, and so on, then use JohnWalker.jpg for the string in the spreadsheet file, and the File Names Begins With option from the File Name Options drop-down on the Image tab. Images will be returned based on what you specify in the Order By drop-down, and Fuga will attempt to place as many images as there are frames for, and leave any extra frames empty.

Graphics Frame Fitting Drop-down
Specifies frame fitting. 

  • Use Frames Fitting Options – Default. The frame is fit according to the frame’s fitting options as specified in InDesign by going to Object > Fitting > Frame Fitting Options.
  • No Fitting – The file is placed into the frame at full size, and the frame size remains the same.
  • Fit Content to Frame – The file is scaled to fit the size of the frame.
  • Fit Content to Frame Proportionally – The file is scaled proportionally to fit the size of the frame.
  • Fit Frame to Content – The file is placed into the frame at full size, and the frame scales to fit the content.
  • Fill Content To Frame – The file is scaled proportionally so that it fills the entire frame.
Directory Location Drop-Down
Tells Fuga where to look for the file to place. You must set each of these directories except for the document directory using the Set Directory action. For more on file paths and their options, see the topic article on File Paths

  • Absolute Path – Default. Specifies that the Directory field contains the absolute path of the file.
  • Relative to Global Directory – Searches for the file in the global directory as set using the Set Directory action.
  • Relative to Document Directory – Searches for the file the directory that the current InDesign document is located in, unless the Document directory has been changed using the Set Directory action. The document must be saved in order to use this option or an error will be raised.
  • Relative to Database Directory – Searches for the files in the database directory as specified using the Set Directory action.
  • Relative to Images Directory – Searches for the files in the images directory as specified using the Set Directory action.
  • Relative to innd Files Directory – Searches for the files in the InDesign documents directory as specified using the Set Directory action.
  • Relative to Logo Directory – Searches for the files in the logo directory as specified using the Set Directory action.
  • Relative to Output Directory – Searches for the files in the output directory as specified using the Set Directory action.
Search Subfolders Checkbox
Specifies if you would like to search for files within sub-folders of the specified directory. 

  • Unchecked – Default. Searches only the top level folder of the directory for the file or relative path specified in the spreadsheet.
  • Checked – Searches the top level folder and its subfolders for the file specified in the spreadsheet.
File Name Options Drop-Down
Specifies how the string from the column relates to the file or files you would like to place. This does not take into consideration the file extension, since the file extension to search for is specified using the File Type drop-down. 

  • File Name Matches String – Searches for files whose names match the file name portion of the string in the spreadsheet.
  • File Name Contains String – Searches for files whose names contain the file name portion of the string in the spreadsheet.
  • File Name Begins With String – Searches for files whose names begins with the file name portion of the string in the spreadsheet.
  • File Name Ends With String – Searches for files whose names ends with the file name portion of the string in the spreadsheet.
File Type Drop-down
Specifies the file extension to search for.
 

  • Use Filename Extension – Default. Searches for only files with the extension specified in the file extension portion of the string in the spreadsheet.
  • Search All File Extensions – Searches for files with any extension.
  • Search for JPG – Searches for only JPG files.
  • Search for PSD – Searches for only PSD files.
  • Search for DOC – Searches for only DOC files.
  • Search for AI – Searches for only AI files.
Order By Drop-down
Specifies in what order to return the files. This is useful when you have multiple image files with the same name, and this can also be helpful when placing files into multiple frames. Fuga will place as many files as there are frames for in the order they are returned. No matter how the files are ordered, Fuga will always try to place a file that’s an exact match to the string first (i.e., for the string JohnWalker.jpg, if Fuga finds a file JohnWalker.jpg, it will always try to place it before JohnWalker1.jpg, no matter what option is selected from this menu). 

  • No Order - Default. Files returned arbitrarily. This option is the quickest, as no sorting is needed.
  • Modified Date Ascending - Files returned from the least recently modified to the most recently modified.
  • Modified Date Descending- Files returned from the most recently modified to the least recently modified.
  • Alphabetic Ascending – Files returned in reverse alphabetical order, with letters coming before numbers.
  • Alphabetic Descending – Files returned in alphabetical order, with numbers coming before letters.
  • Size Ascending – Files returned from smallest to largest file size.
  • Size Descending – Files returned from largest to smallest file size.

Text Tab

Text Frame Fitting Drop-down
Specifies text frame fitting. 

  • No Fitting – Default. The frame is not altered to fit to the text.
  • Fit Frame to Content – The the frame scales to fit the text.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>