You are here: Query > Map the object fields for the query

Map the object fields for the query

When you click Next, Studio moves to the Map tab, which includes:

  • Mapper: The Mapper contains the fields you can select and the Value column.
  • Data File Preview: The Data File Preview displays a preview of the Excel worksheet where the fields selected from Mapper are mapped.

Any required fields, such as Log Column, are automatically selected.

Mapping fields for a query involves three steps:

  1. Map the fields.
  2. Add conditions.
  3. Preview the results.

Map the fields

  1. In the Mapper, select the check boxes for the fields you want to include in your script.

    To quickly find a field, type it in the Search box. After you select the fields you want, return to the full Mapper by deleting the text in the Search box.

    Custom fields are listed in their own section of the Mapper.

    Tip: To select all the fields in a group, select the group-level check box.

  2. Map the fields to the Excel worksheet by doing one of the following:
    • On the ribbon, click Auto Map.
    • Type the Excel column name that corresponds to each field in the Value column in the Mapper.
  3. Click Save Data File and save the data file.

Before you run the query, you can set conditions so that only the records with the specified values are returned in the query results.

Add conditions to the query

To define the data that will be downloaded, create a condition.

  1. On the Map tab, click Condition Builder.

    The Condition Builder box opens.

  2. Select the field.

    The default is All Fields.

  3. In the Field Description box, click the field you want.
  4. In the Value Type box, choose Fixed Value.
  5. In the Comparison box, choose an operator from the list.

    The list shows only the operators that match the data type.

  6. In the Value box, type the number or text.
  7. Choose And or Or if you want to add more conditions.
  8. Click the Add icon.
  9. Repeat for any other conditions, and then click OK.

Notes:
To add multiple values, such a Number of Employees > 50 and < 500, use the left bracket on the first value and the right bracket on the last value.

You can nest up to five conditions in the query.

For more information about conditions, see Add a condition.

Preview the Query results

Before you download the data from Salesforce, confirm that the query will return the correct results. If the preview does not look the way you want it to, you can adjust the mapping before you continue to the Run tab.

  1. Click Preview Run.
  2. Check the results.

    The preview generates a maximum of 100 records.

  3. Click OK.
  4. Make any changes you want to the mapping.
  5. Click the Run tab.

    Studio for Salesforce will prompt you to save the data file.

Other mapping commands

  • Select All: To automatically select all the fields that are displayed in the Mapper, click Select All.
  • Refresh: To reload the fields that are displayed in the Mapper whenever any changes are made to the Salesforce Customer Site content, click Refresh.
  • Filter Fields: To control which fields are visible in the Mapper, click Filter Fields, and then click the option that you want.
  • Add Sheet: To add new data to the data file and use the same script, click Add Sheet. After you click the Run tab, click Write Headers and then enter the data you want to upload.