diff --git a/src/cdk/v2/destinations/algolia/procWorkflow.yaml b/src/cdk/v2/destinations/algolia/procWorkflow.yaml index 328aad4314..87da64aa45 100644 --- a/src/cdk/v2/destinations/algolia/procWorkflow.yaml +++ b/src/cdk/v2/destinations/algolia/procWorkflow.yaml @@ -50,18 +50,13 @@ steps: description: | Populate list of objectData template: | - const populateObjectData = function(singleProduct) { - singleProduct.({ + const products = ^.message.properties.products + products.($.removeUndefinedAndNullValues({ "queryID" : $.isDefinedAndNotNull(.queryID) ? String(.queryID) : null, "price": $.isDefinedAndNotNull(.price) && $.isDefinedAndNotNull(^.message.properties.currency) ? String(.price) : null, "quantity": $.isDefinedAndNotNull(.quantity)? Number(.quantity) : null, "discount": $.isDefinedAndNotNull(.discount) ? String(.discount) : null - }) - }; - const products = ^.message.properties.products - products.map(function(singleProduct) { - $.removeUndefinedAndNullValues(populateObjectData(singleProduct)) - })[] + }))[] - name: populateProductsData condition: |