HomeGuidesDeveloper HubRelease Notes
Get supportBook a chat
Guides
These docs are for v2.76. Click to read the latest docs for v2.208.

Libraries

Libraries are stacks which extend Fielo's functionalities. They comprise a suite of data such as Behaviors, Actions and Models designed to achieve more capabilities for your incentive and loyalty program.

Each Fielo package includes its own reusable Library. For example, if you install and setup Proof of Purchase, you'll have its corresponding library, FieloPRP, installed and ready to be enabled. You can also have and manage your own Library - FieloLocal Library - in which you can save all your custom-made Behaviors, Actions and Models to reutilize as you like.

Managing Libraries

You can manage libraries from the Tools tab, in the Libraries section. By default, all libraries are Inactive, but we guide you through how to enable them every time you install a new package - i.e. when installing and setting up Fielo, one of the last steps you need to do is to enable FieloPLT Library; when you're setting up any Incentive and Loyalty Apps, we walk you through how to enable their corresponding Libraries (i.e. FieloPRP, FieloELR, FieloBCP).

1350

Libraries

Upgrading Libraries

Libraries might change when upgrading Fielo. In the event of a new version of a Library is available, you'll be given the option to upgrade them. To do so, just click Upgrade next to the Library status and you are all set.

1349

Upgrading FieloPLT Library

Once you've upgraded, note that the Version Number has also changed, displaying the newly updated version. In this example, we've upgraded FieloPLT, but the process is the same for all other installed packages, such as FieloPRP, FieloELR, FieloBCP, etc.

FieloPLT Library

Fielo comes with its own default library called FieloPLT. It includes by default Behaviors, Action, and Models.

1349

FieloPLT Library

Behaviors

Behaviors let you decide what Salesforce objects you want to create incentives for. You can choose to drive a particular behavior by using the Single Action Engine- for example, award your members every time they log in to your loyalty portal - or you can encourage your members to carry out a set of activities in certain order, time frame or number by means of Multi-Action Engine - e.g. you award your members after logging into your portal 5 times.

Single Action Engine is externalized in Promotions, the same way Multi-Action Engine does so in Challenges.

Actions

Actions let you decide which practices and participants you want to incentivize. To create an Action, first you need to create a behavior that's associated with a Salesforce object.

Models

Models are pre-configured, reusable Incentives and Programs templates you can use to create Programs and Incentives easier and faster. FieloPLT library doesn't come with any Model, but some other Fielo packages, such as Proof of Purchase or E-learning, do bring some Models you can start using from scratch.
You can create new Models and reuse them any time you want! All of your own created Models are stored in FieloLocal library.

Activating and deactivating FieloPLT Library

You must enable FieloPLT library to use Fielo, as it contains all Page Settings that control every page layout and design. For that reason, it's one of the last step while setting up Fielo.

To enable FieloPLT library - and any other Library as well - just hit Activate on the right area of the Inactive section on the Tools tab. You'll see how FieloPLT moves from Inactive to the Active section, which makes it ready for you to click and access it.

❗️

Inactive FieloPLT Library

If FieloPLT library is inactive you won't have access to any Fielo pages.

1366

Activating FieloPLT Library

Get from GitHub

You can access our Github public repository, which includes different plugins to extend Fielo functionality. These plugins may be used for several specific solutions which can be applied to any of your customers' particular needs.

1590

Get from Github

FieloLocal Library

FieloLocal library represents a local repository you can use to create and store your own Behaviors, Actions and Models, independently of the default Libraries that come after installing different Fielo packages.
To enable FieloLocal library - and any other Library as well - go to the Tools tab and select Libraries. On the Inactive status section, click Activate.

1366

Activating Local Library

Once you've accessed FieloLocal, you are free to create all the Behaviors, Actions and Models you want!

Advanced Features: Import/Export and Data Portability Utilities

The Import/Export and Data Portability utilities provide a simple way for you to specify what data you want to export. Exporting is available for Programs, Members (via Data Portability), Incentives, Rewards and Libraries.

Create an Export Config file

The first thing you need to do is to create an Export Config file. Export Config is a JSON file that includes two elements:

  • configObjects: Here you can define all metadata from the objects you need to export, which includes their External ID and the fields to exclude.
  • configModel: Here you define the data model to export, being sure to include any parent or related objects and lookup fields. You can also define a record filter using a whereCondition
{
   "configObjects":[
      {
         "apiName":"ExampleObject__c",
         "externalId":"ExampleField_ExternalID",
         "fieldsToExclude":"ExcludedField1__c,ExcludedField2__c",         "fieldsToExcludeModel":"ExcludedField1__c,ExcludedField2__c,ExcludedField3__c"
      },
      {
         "apiName":"AnotherExampleObject__c",
         "externalId":"AnotherExampleField_ExternalID"
      }
   ],
   "configModel":[
      {
         "apiName":"ExampleObject__c",
         "relatedObjects":[
            {
               "apiName":"RelatedObject__c",
               "relationship":"LookupExampleField",
               "relatedObjects":[
                  {
                     "apiName":"ParentObject__c",
                     "relationship":"LookupExampleField",
                     "whereCondition":"[{\"field\":\"AFieldToFilter__c\",\"operator\": \"=\",\"value\":\"SomeValue\"}]"
                  }
               ]
            },
            {
               "apiName":"AnotherRelatedObject__c",
               "relationship":"AnotherLookupExampleField"

            }
         ]
      }
   ]
}

Format your whereCondition

If using a WHERE condition, it must be in the form of a JSON string. For instance, the SOQL fragment WHERE FieloPLT__IsActive__c = true OR FieloPLT__IsActive__c = false AND LastModifiedById IN IsActive can be expressed as follows:

[
  {
    "andOrOperator": "",
    "field": "FieloPLT__IsActive__c",
    "operator": "=",
    "value": "true",
    "subQueryFilter": null
  },
  {
    "andOrOperator": "or",
    "field": "FieloPLT__IsActive__c",
    "operator": "=",
    "value": "false",
    "subQueryFilter":
    {
      "field": "IsActive",
      "objectName": "User",
      "filters":
      [
        {
          "andOrOperator": "and",
          "field": "LastModifiedById",
          "operator": "in",
          "value": "IsActive",
          "subQueryFilter": null
        }
      ]
    }
  }
]

Each JSON object represents an expression.

For the "andOrOperator" key, use an empty string ("") for the first expression. Use "and" or "or" in subsequent expressions to indicate the relation with the previous expression. If your WHERE condition will only contain one expression, set "andOrOperator" to null.

For "field", enter the API name of the field being used in the expression.

For "operator", specify how you want to compare "field" with "value". Use can choose from "=", "!=", "<", "<=", ">", ">=", "in", "not in" and "like".

For "value", enter the value you want to compare "field" with, which could be "true" or "false", a numerical value, or even the API name of another field.

For simple queries, you can set "subQueryFilter" to null. If using subqueries, the object should specify the "field" to be compared and, for "objectName", the API name of its related object. The subquery "filters" have the same structure as simple queries.

Now, imagine that you've created your own Page Settings to customize certain page layouts and you only need to export these Page Settings, but not the whole FieloLocal library - no Actions nor Models. To do this, the first thing you need to do is create a Config as follows:

{
   "configObjects":[],
   "configModel":[
      {
         "apiName":"FieloPLT__PageSettings__c",
         "whereCondition":"[{\"field\":\"FieloPLT__Library__r.Name\",\"operator\": \"=\",\"value\":\"FieloLocal\"}]",
         "relatedObjects":[]
      }
   ]
}

Upload Your Configurations to Salesforce

Once the config file is ready, it's time to upload it to Salesforce.

First, go to Salesforce Setup and access Static Resources. Click New to create a new Static Resource.

1580

New Static Resource

Now, enter the name for your Static Resource and upload the config file containing the JSON definition of what we want to export.

In this example, we're using the JSON config file for the Page Settings that we created before.

After clicking Save, you're ready to use your new JSON config file.

📘

We advise you to give your Static Resource and JSON config the same name.

Link Your Config File to a Library

Lastly, you need to connect the configurations you've created before to the corresponding Fielo Library.

Internally, all information from each Fielo product is stored in different Libraries, i.e. all data included in Programs, Members, Incentives, Rewards, etc. is stored in FieloPLT library; all Courses, Modules and Questions are linked to the FieloELR library, and all Invoices to the FieloPRP library.

So, once you've created and uploaded your config JSON file to Salesforce, go to the appropriate library where the information you're exporting is stored. Here we're accessing FieloLocal library as we're using the same example from our custom Page Settings.

1594

Page Settings in Local Development Library

Now, switch to Salesforce Classic and change the URL by deleting /apex/apex/LibraryView?id=and adding ?nooverride. You'll notice that library details are displayed, including a Resources field.

Add the key-value pair corresponding to the name of the object you want to export and the name of the static resource you created - in our example {"pagesettings":"ExportConfigPageSettings"} - that you created before and hit Save.

1342

Resources

Note that the JSON object can contain multiple key-value pairs, separated by commas, for various object-resource pairings. Here are some possible options from the FieloPLT library:

KeyObject / Purpose
"programs"Program export
"libraries"Library export
"promotions"Promotion export
"challenges"Challenge export
"incentives"Promotion and Challenge export
"rewards"Reward export
"badges"Badge export
"members"Member (Data Portability) export
"memberAnonymize"Configs for Member anonymizaton
"memberMerge"Configs for the Merge Members API method

Using your Config File

Once you've created and uploaded the JSON config file containing the data you'd like to export, and linked it to Fielo, you can access it to download the data.

For that, you need to access a base URL as follows:
https://[app:Instance URL]/apex/fieloplt__xmlexport?exportPoint=yourConfig

You can include other parameters in the URL depending on the information you want your JSON export file to have:

  • exportPoint: Name of the config to download. This parameter is mandatory.
  • library: Here you can define the Library in which the Export Point is stored.
  • exportType:
  • exportRecords: Here you can set the IDs of the records to export. The parameter should be structured as follows: ExampleObject__c:recordId1,recordId2;AnotherExampleObject__c:recordId1.

For our Page Settings example, the URL we use is made up like this:
https://[app:Instance URL]/apex/fieloplt__xmlexport?exportPoint=pagesettings&library=FieloLocal


Did this page help you?