Standardized Lookups

The flow of standardized lookups:

  1. Lookup Configuration is parsed. It can either be read from PP or passed as a function parameter.

  2. Table name (or names) are determined.

  3. Table type is determined.

  4. Once for a batch (by default 200 products), a DB lookup is performed.

    1. Custom Filter is parsed to a Filter object.

    2. SKU and secondary key (with optional transformation) are parsed into a batch Filter.

    3. If using PSP DependencyMapping, corresponding filters are applied.

    4. FieldNames are translated into attributesID.

    5. Lookup is performed.

      1. There is a check if the data lookup threw any exception. Any exceptions are propagated further for every product in the batch so that config issues are easier to debug.

    6. Data is grouped per SKU and secondary key (if the lookup did not fail).

    7. Data is saved into api.global.

  5. Data for a current item is read.

  6. If using PSP DependencyMapping, the best matching dependency level is selected.

  7. Data is transformed to be under keys specified in selectedFields.

  8. Data checks are performed, according to the checksConfig configuration.

  9. Data lookup is registered for debugging (registering keeps the data for other products in the batch).

  10. Data for SKU is read.