Mapping
A Map-type dataslot is a type of User Setting that allows your users to define a mapping between an object in your application (an “Application Object”) and an object in their connected integration account (an “Integration Object”).
Step 1: Adding to the User Portal
Map dataslot settings can be added by visiting the “configure” option inside an application on your dashboard.
An example of a map-type dataslot. For eg. List of fields in Mailerlite can be mapped with user inputs.
Step 2: Getting map-type config from frontend SDK
Use the config() function to get the config of a particular app.
cobalt.config('mailerlite','configid');
Let’s look at a sample response of map-type dataslot.
As you can see, the previously empty ‘labels’ array now has the options configured above on the platform - ‘Name’ and ‘Email’.
Step 3: Updating value of map-type config
Use the updateConfig() function to save the selected value. In this case an object with respective labels and their values will be needed to pass.
It will return the same response as config() functions with updates in the changed value. You will notice that the value is now added in the object.
Summary of setting a map-type config dataslot using config() and updateConfig() functions