End User-defined schema
OverviewCopy
Here we take you through data mapping use cases where the End User configures the mapping for their solution instance.
1. Hardcoded list + allow custom valuesCopy
There may be some cases where it is too restrictive for your End Users to only be able to choose from a pre-configured list of fields.
For example, your End Users might be using different MySQL database tables with different field names and you want them to be able to name the fields to be mapped to themselves.
One End User may wish to set up the following mapping:
Service 1 | Service 2 |
---|---|
name | account_name |
id | stripe_id |
phone | cellphone |
email_address |
While another may wish to set up the following mapping:
Service 1 | Service 2 |
---|---|
name | customer_name |
id | id |
phone | mobile |
To do this you can follow the usual procedure for data mapping, as outlined in the Hardcoded Example.
Config wizard stepsCopy
Then, when editing the Config Wizard in the Solution Editor, you can:
End-user experienceCopy
2. Using input and output schemaCopy
Before continuing to the instructions below, note that picking fields from drop-downs which come from the auto-generated connector schemas is in theory an easy and simple method. However, it will not always be possible to use the input and output schema of connectors, as sometimes they will not produce fields you are trying to get to which may be one or two layers deep into the schema (e.g. the name of an assignee for an Asana task may be found in $.steps.asana-1.data.assignee.name
).
If this is the case you should hardcode your lists and extract the nested data.
The example from the previous pages on hardcoding and mapping nested data is a good illustration, in that the Output schema for the Stripe 'List Customers' operation only shows the top-level 'Data' field and cannot drill down into id, name, currency etc.:
A very simple (and unrealistic!) example of using input/output schema is setting up a mapping for a workflow whereby each time a new Slack channel is created a Dropbox folder is created with the name of the channel mapped to the name of the folder.
So here you could use the following setup:
In deciding whether to use an input or an output schema for a particular operation, it will depend on what data is returned by either schema, and whether it is usable.
In the example above we could have used the output schema for the Slack 'Create channel' operation but this only returns the 'Channel' as an object, and the name is nested within it.
So using the input schema was necessary.
If you need to create a more detailed mapping with some of the nested data from within the channel object, you would need to use the hardcoded example with nested values approach detailed in the Mapping Nested Data guide (making use of Object Helpers).
3. Using Dynamic Lookup SchemaCopy
An example of when you might use this is if the operation you are mapping to has multiple types, and the required data will change depending on the type.
Dynamic lookup can also be used as an alternative to hardcoding when you need to get at nested values.
The Salesforce 'Create record' operation is a good example. In the hardcoded example we use it to create an Account, but you might also want your End User to be able to choose which type of record gets created - it could be a Lead or a Contact.
In this case, your End User would be able to choose from a type drop-down in the Config Wizard:
The available fields then change depending on whether they choose
Setting up a dynamic lookupCopy
Allowing users to enter custom valuesCopy
4. Using Config SlotsCopy
To do this you can follow the usual procedure for data mapping, as outlined in the Hardcoded Example.
The extra key steps are: