Loading
Salesforce now sends email only from verified domains. Read More
Media Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Use Salesforce CPQ Context Rules to Fetch Products

          Use Salesforce CPQ Context Rules to Fetch Products

          Salesforce CPQ's context rules are used to retrieve Digital media products. To enable context rules to fetch digital media products, you must create a data mapper, configure an integration procedure, and then ensure that the isProductFetchServerEnabled custom setting is configured.

          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.

          REQUIRED EDITIONS
          Available in: Lightning Experience
          Available in: all editions
          REQUIRED USER PERMISSIONS  
          To access Media Cloud advanced features: MediaCloudPlus Runtime
          To create, read, update, and delete Flexcards: Omnistudio Admin

          To use the context rules, you must use ‌server-side mode. The cache mode doesn’t support context rules.

          1. Create an Omnistudio Data Mapper Transform with these details:
            • Name: FilterQualifiedProducts
            • Interface Type: Transform
            • Input Type: JSON
            • Output Type: JSON
            See Create an Omnistudio Data Mapper Transform if you are working with Omnistudio or Create an Omnistudio Data Mapper Transform in Omnistudio for Managed Packages if you are using Omnistudio for Managed Packages.
          2. Add these formulas in the specified sequence:
            Sequence Number Formula Formula Result Path
            1 LIST(%GetCartProducts:messages%) Messages
            2 FILTER(LIST(%GetCartProducts:records%), 'category == "Qualified"') FilteredProductsList
            3 IF(ISBLANK(FilteredProductsList),0,LISTSIZE(FilteredProductsList)) TotalQualifiedProducts
            4 %GetCartProducts:totalSize% - TotalQualifiedProducts TotalDisqualifiedProducts
            See Use Formulas in Omnistudio Data Mappers if you are working with Omnistudio or Use Formulas in Omnistudio Data Mappers in Omnistudio for Managed Packages if you are using Omnistudio for Managed Packages.
          3. Map the result of each formula to the output structure:
            Input JSON Path Output JSON Path Output Data Type
            Messages GetCartProductsFiltered:messages List<Map>
            FilteredProductsList GetCartProductsFiltered:records List<Map>
            TotalDisqualifiedProducts GetCartProductsFiltered:totalDisqualifiedProducts N/A
            TotalQualifiedProducts GetCartProductsFiltered:totalSize
            See Use Formulas in Omnistudio Data Mappers if you are working with Omnistudio or Use Formulas in Omnistudio Data Mappers in Omnistudio for Managed Packages if you are using Omnistudio for Managed Packages.
          4. Open the latest version of the vplAds/GetCartProducts integration procedure.
            If your latest version of the integration procedure is active, deactivate it first.
          5. Open the GetProducts element and add this key/value pair:
            Key includeIneligible
            Value true
          6. Add Data Mapper Transform Action element after the GetProducts element and specify these details:
            Element Name GetQualifiedProducts
            Data Maper Interface FilterQualifiedProducts
            Send JSON Path %GetProducts%
            Send JSON Node GetCartProducts
            Response JSON Path GetCartProductsFiltered
          7. Open the SuccessResponse element and make these changes:
            1. Update the value of the GetProducts key to %GetQualifiedProducts%.
            2. Update the value of the Execution Conditional Formula to:

              ISNOTBLANK(%offset%) AND (%GetQualifiedProducts:totalSize% > 0 OR (%GetQualifiedProducts:totalSize% == 0 AND %GetQualifiedProducts:messages|1:code% == '101') OR (%GetQualifiedProducts:totalSize% == 0 AND %GetQualifiedProducts:totalDisqualifiedProducts% > 0

          8. Open the FailureResponse element and make these changes:
            1. Update the value of the Send JSON Path to GetQualifiedProducts.
            2. Update the value of the Execution Conditional Formula to:

              %GetQualifiedProducts:totalSize% == 0

          9. From Setup, open the Media Configuration custom setting and click Manage.
            1. Click isProductFetchServerEnabled.
            2. Click Edit and select Setup Value.
            3. Save your changes.
            If you can't find isProductFetchServerEnabled in the Media Configuration custom setting, then you must create it with the specified values.
           
          Loading
          Salesforce Help | Article