Overview
Mapping of fields in Audience Builder can be a monumental task if you are dealing with hundreds of fields. To help with this, we have created a stored procedure to autocreate much of the fields in a temporary table.
Prerequisites
The user that will create and run the stored procedure will need enough permissions to do it successfully. This is a minimum set of permissions to do this is below. The assumption is that the tables and views that the stored procedure will access are in the same database and schema. You may need to add more grants to select from.
The variable to fill in are noted below
- TARGET_DATABASE: The database where the source tables and view are, and where the procedure will be created
- Example: BETTRDATA
- TARGET_SCHEMA: The schema where the source tables and view are, and where the procedure will be create
- Example: STAGING
- TARGET_ROLE: The role of the user to create and run the stored procedure
Once this is done, the user should be able to create and run the stored procedure. The script below shows the logic
Calling the stored will return a set of rows that matches the format of the data-source-fields.csv that can be downloaded and uploaded to an Audience Builder data source fields dialog. Download this as a CSV file.
Example Output
NAME | LABEL | DISPLAYTYPE | CATEGORIES | validations.min | validations.max | validations.value | validations.value_label | validations.minDate | validations.maxDate |
AGE | AGE | selection-multi | Default | 36 | 36 | ||||
AGE | AGE | selection-multi | Default | 64 | 64 | ||||
AGE | AGE | selection-multi | Default | 80 | 80 | ||||
AGE | AGE | selection-multi | Default | 89 | 89 | ||||
AGE | AGE | selection-multi | Default | 71 | 71 |
Additional Steps
You will need to change the label and categories to match to your preference, but that will be a matter of selecting the relevant column values and replacing.