Loading
PHP Vulnerability Monitoring Read More
Media Cloud
Add Attributes to the Grid on the Configure & Add Media Placements Screen

Add Attributes to the Grid on the Configure & Add Media Placements Screen

In Advertising Sales Management , you can add attributes to the grid on the Configure & Add Media Placements screen of the Create or Modify Media Plan workflows.

Managed Package Icon This is an Advertising Sales Management on Managed Package feature. For Advertising Sales Management on Salesforce Platform, see Advertising Sales Management on Salesforce Platform.

Note
Note

Currently, Advertising Sales Management does not support lookup fields.

  1. Use the app launcher to navigate to OmniStudio FlexCards.
  2. Click the latest version of the grid FlexCard corresponding to the media type that you're configuring.

    This table lists the Flexcards for each media type.

    Media Type Flexcard
    Digital sfiAdsDigitalGrid
    TV sfiAdsTvGrid
    Print sfiAdsPrintGrid
    Radio sfiAdsRadioParentGrid
  3. Click Setup.
  4. Include the attribute name in the values field corresponding to the columns field, along with the attributeCode ("fieldName") and data type of the attribute ("type").

    The sequence in which values are added determine the ordering of the columns in the grid.

    Note
    Note

    If the attribute is a picklist, then ensure that the default value for the picklist has been set in the Vlocity Product Console. The attribute values must be included in the Product2.JSONAttribute field.

    For example, to add the attribute "Edition" to the Grid as a separate column, use the following JSON in the Value field for Columns.

    {"fieldName":"Edition","label":"Edition","Placeholder":"—","searchable":false,"sortable":true,"type":"picklist","editable":true,"displayEditIcon":"editEditionTypeFlag","visible":true,"userSelectable":true,"optionField":"EditionOptions","textAlign":"left","columnWidth":"6%","columnType":"attribute"}

    "columnType":"attribute" determines whether the selected column is a product attribute while updating the field value.

    Note
    Note

    The value for optionField and fieldName must be set in the vplAds-fetchMediaPlanPlacement Omnistudio Data Mapper.

  5. To display picklist options in the grid, use the app launcher to navigate to OmniStudio Data Mapper.
  6. Click the Data Mapper vplAds-fetchMediaPlanPlacement and click FORMULAS.
  7. Include the following Formula for the Attribute Category Code (AttrCategoryCode):
    FILTER(LIST(%LineItem:ProductAttribute:AttrCategoryCode%),'attributeuniquecode__c == "Edition"')
    
    Formula Result Path - LineItem:EditionProductAttribute
  8. Include the following Formula to handle whether the attribute is read only or is editable.
    Formula Result Path - LineItem:editEditionTypeOptions
    NOT(%LineItem:EditionProductAttribute:isreadonly__c%)
    
  9. Go to the OUTPUT tab, and add the following nodes in the output:
    Output JSON Path: dataPreArray:editEditionTypeFlag
    Extract JSON Path: LineItem:editEditionTypeOptions
    
  10. To add the optionField value that you'd specified in the vplMediaTypeTabs FlexCard and display the picklist fields, add the following JSON:
    Extract JSON Path: LineItem:EditionProductAttribute:attributeRunTimeInfo:values:displayText
    Output JSON Path: dataPreArray:EditionOptions:label
    
    Extract JSON Path: LineItem:EditionProductAttribute:attributeRunTimeInfo:values:value
    Output JSON Path: dataPreArray:EditionOptions:value
  11. To add the optionField value that you'd specified in the vplMediaTypeTabs FlexCard and display the userSelected Value, add the following JSON
    Extract JSON Path: LineItem:@Edition
    Output JSON Path: dataPreArray:Edition

The grid includes a column for the attribute you've specified.

Note
Note

To display an attribute only in the grid and not in the modal, in the Vlocity Product Console, set the value of the Attribute Metadata hidden field to true for the particular attribute.

Similarly, for datatype (including numbers, text currency, percentage, date, datetime, and checkbox), use the following JSON:

{"fieldName":"AttrCode","label":"Column label","Placeholder":"—","searchable":false,"sortable":true,"type":"fieldType","editable":true,"displayEditIcon":"editAttrCodeTypeFlag","visible":true,"userSelectable":true,"textAlign":"left","columnWidth":"6%"}

Add the following under the FORMULAS tab:

Formula - FILTER(LIST(%LineItem:ProductAttribute:AttrCategoryCode%),'attributeuniquecode__c == "AttrCode"')
Formula Result Path - LineItem:AttrCodeProductAttribute
Formula - NOT(%LineItem:AttrCodeProductAttribute:isreadonly__c%)
Formula Result Path - LineItem:editAttrCodeTypeFlag

Add the following in the OUTPUT tab:

Extract JSON Path: LineItem:editAttrCodeTypeFlag
Output JSON Path: dataPreArray:editAttrCodeTypeFlag
Extract JSON Path: LineItem:@AttrCode
Output JSON Path: dataPreArray:AttrCode

Similarly, for multiselect picklist, here is the column configuration:

{"fieldName":"AttrCode","label":"MultiSelectPicklistAttrLabel","Placeholder":"—","searchable":false,"sortable":true,"type":"multiselect","editable":true,"displayEditIcon":"editAttrCodeTypeFlag","visible":true,"userSelectable":true,"optionField":"AttrCodeOptions","textAlign":"left","columnWidth":"6%","postFix":"LineItem:additionalAttrCodeMultiSelectCount","columnType":"attribute"}

Add the following under the FORMULA tab:

Formula - FILTER(LIST(%LineItem:ProductAttribute:AttrCategoryCode%),'attributeuniquecode__c == "AttrCode"')
Formula Result Path - LineItem:AttrCodeProductAttribute

Formula - NOT(%LineItem:AttrCodeProductAttribute:isreadonly__c%)
Result Path - LineItem:editAttrCodeTypeFlag

Formula - LIST(LineItem:AttrCodeProductAttribute,';')
Result Path - LineItem:splitListArray

Formula - FUNCTION('MediaAdSalesAppHandler','split',LineItem:splitListArray)
Result Path - LineItem:splittedArray

Formula - LISTSIZE(LineItem:splittedArray) -1
Result Path - LineItem:additionalAttrCodeMultiSelectCount

Add the following in the OUTPUT tab:

Extract JSON Path: LineItem:editAttrCodeTypeFlag
Output JSON Path:dataPreArray:editAttrCodeTypeFlag

Extract JSON Path: LineItem:AttrCodeProductAttribute:attributeRunTimeInfo:values:displayText
Output JSON Path: dataPreArray:AttrCodeOptions:label

Extract JSON Path: LineItem:AttrCodeProductAttribute:attributeRunTimeInfo:values:value
Output JSON Path: dataPreArray:AttrCodeOptions:value

Extract JSON Path: LineItem:additionalAttrCodeMultiSelectCount
Output JSON Path:dataPreArray:additionalAttrCodeMultiSelectCount

Extract JSON Path: LineItem:@AttrCode
Output JSON Path:dataPreArray:AttrCode
 
Loading
Salesforce Help | Article