Skip to main content
Skip table of contents

Set Up a Data Export Option


Administrators can give constituents the ability to download data in a file format such as CSV, JSON, etc. within Community Hub. By default, data can be exported as a CSV file, but additional file formats can be exported through development effort.


  1. By default, data is downloaded as a CSV file. If you want to export a file other than a CSV, you'll need to create a custom Apex class through development effort and create an export configuration record.

    Create an Export Configuration...
    1. From Setup, enter Custom Metadata Types in the Quick Find box, then select Custom Metadata Types.
    2. Click Manage Records next to the Export Configuration custom metadata type.
    3. Click New.
    4. In Label, enter an easily recognizable term to identify the export configuration using Pascal Case.
    5. In Class, enter the name of an Apex class that implements the NC.IDataSourceExportService interface.
    6. Click Save.
  2. Create a data export URL which uses a data source, a field set, and optionally, an export configuration record.

    Create a Data Source...
    1. In the tab bar, click 
      App Launcher, or in Salesforce Classic, click 
      Nimble AMS, Staff View, Button, All Tabs.
    2. Search and select Community Hub Setup.
    3. In the tab bar, click Data Sources.
    4. Click New Data Source.
    5. In Name, enter an easily recognizable term to identify this data source.

      If you have multiple Community Hubs, and intend to use a similar data source in each, we recommend you name each after the Community Hub in which it will be used, so you can distinguish them.

    6. In Description, enter a description of what the data source does.
    7. In Class, enter SOQLDataSource.
    8. In Context, begin typing the name of the SOQL query record you would like to use and select it from the list of results.

      If you have multiple Community Hubs, keep in mind whether the SOQL query should filter for only records associated with the entity(s) for the Community Hub in which this data source will be used, or if you want to return records from all entities.

    9. Click Save.
    Create a Field Set...
    1. Navigate to the field set editor:
      • If you are creating a field set for a standard Salesforce object:
        1. From Setup, go to the Object Manager.
        2. Click the object name. For example: Account
        3. Click Field Sets.
        4. Click New.
      • If you are creating a field set for a Nimble AMS on custom object:
        1. From Setup, go to the Object Manager.
        2. Click the object name. For example: Appeal
        3. Click Field Sets.
        4. In the field sets section, click New.
    2. In Field Set Label, enter an easily recognizable term to identify this field set written in Pascal Case.
    3. Field Set Name should match Field Set Label.
    4. In Where is this used?, enter the name of the page on which the field set will be used.
    5. Click Save.
    6. Click and drag fields from the palette into the In the Field Set area in the order you want them to appear on the card.

    7. Click Save.
    Data Export URL Example...

    Example data export URL: https://community.iamnimble.org/nc__datasourceexport?ds=UpcomingEvents&fs=NC__UpcomingEventsItem&on=NU__Event__c&config=TabDelimited

    URL Parameters and What They Do

    Parameter
    Description
    Example
    Note
    dsThe name of the data source to use for retrieving the data.UpcomingEventsRequired
    fsThe name of the field set to use which defines the fields to include in the export.NC__UpcomingEventsItemRequired
    onThe name of the primary object type being queried by the data source.NU__Event__cRequired
    configThe name of the export configuration record.TabDelimitedOptional - Only needed if exporting a file type other than CSV.
  3. Create Community Hub component constituents can click to download the file in Community Hub:
    1. Create a button with the data export URL in URL (recommended).

      Create a Button...
      1. In the tab bar, click 
        App Launcher, or in Salesforce Classic, click 
        Nimble AMS, Staff View, Button, All Tabs.
      2. Search and select Community Hub Setup.
      3. In the tab bar, click Buttons.
      4. Click New Button.
      5. In Name, enter an easily recognizable term to identify the button. 
      6. In Description, enter a description of what the button does. 
      7. If you want to grant or revoke access to the button, in Access Control, select the access control which grants the access you want to use.

        Deactivated access controls cannot be selected.

      8. If you want the button to display only when certain conditions are met using an Apex class, in Class, enter the name of the Apex class.

      9. If the button is a primary user action, select Is Primary Action.

        We recommend that a card only have one primary button, with the opportunity for one or more secondary buttons.

      10. In Label, begin typing the name of the custom label you'd like to use for the button text and select it from the list of results or click new to create a new one.

      11. If you want to set where the button displays on a card, in Location, select the location. If nothing is selected, the button displays in the Left position.

      12. If you want the button to open the page in a different HTML window target, like in a new tab, in Target, enter the HTML Target value.

      13. In URL, enter the path for the page to which the button should link.

      14. In URL Parameter Key, enter the name of the URL parameter to be passed to the page to which the button links. If you leave URL Parameter Key blank, the default URL parameter is id. As an example, the value in URL is yourcommunityhub.com/personalsnapshot, the value in URL Parameter Key is personid, and the button is provided by a data source the value of 12345 for the personid URL parameter. When the button is clicked, constituents are taken to yourcommunityhub.com/personalsnapshot?personid=12345. If you leave URL Parameter Key blank, the default URL parameter is id. In this case, when the button is clicked, constituents are taken to yourcommunityhub.com/personalsnapshot?id=12345.
      15. If you want the button to only display based on certain criteria:

        1. In Object, select the object containing data used to determine whether the button should display.
        2. In Data Source, select the data source that specifies when the button should display. If the data source is based on a SOQL query, be sure to review any tips for making a SOQL query for the entered Class
      16. If you want to trigger custom Javascript behavior when the button is clicked, in On Click, enter the line of Javascript to execute. Learn more about the onClick parameter: apex:commandButton (external).

      17. If you want to trigger custom Javascript behavior after the asynchronous partial postback is complete, in On Complete, enter the line of Javascript to execute. Learn more about the onComplete parameter: apex:commandButton (external).

      18. If you want only certain portions of the page to reload after your button is clicked, in Re Render, enter the id's of the page elements you want to rerender. Learn more about the reRender parameter: apex:commandButton (external).

      19. If you want the button to display a specific label upon successful submission, in Success Label, enter the name of the label.

      20. Click Save.

    2. Create a custom label containing HTML code which includes the data export URL and add it to a card using the DisplayHTML Card Layout.

      Create a Custom Label...
      1. From Setup, click Create | Custom Labels, click New Custom Label.
      2. In Name, enter a name which meets the following standards:
        • It is written using Pascal Case.
        • It contains 1–4 words.
        • It uses only words in Value.
      3. In Short Description, enter a short description which meets the following standards:
        • It is the value in Name.
        • It is written with spaces between each word.
      4. In Value, enter the text to be displayed in Community Hub.
      5. Click Save.

      Add a Card Layout to a Card...
      1. In the tab bar, click 
        App Launcher, or in Salesforce Classic, click 
        Nimble AMS, Staff View, Button, All Tabs.
      2. Search and select Community Hub Setup.
      3. In the tab bar, click Pages.
      4. In Page to configure:, select the page you want to customize.

      5. Click Edit next to the card you want to customize.
      6. In Card Layout, select the card layout you want to use.
      7. Click Save.
  4. Add the new element to a card.

    Add a Button to a Card...
    1. In the tab bar, click 
      App Launcher, or in Salesforce Classic, click 
      Nimble AMS, Staff View, Button, All Tabs.
    2. Search and select Community Hub Setup.
    3. In the tab bar, click Pages.
    4. In Page to configure:, select the page you want to customize.

    5. Click Edit next to the card you want to customize.
    6. In Buttons, select one or more buttons.

      Press CTRL/CMND to select multiple buttons.

    7. Click Save.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.