I’m currently trying to filter out a specific product from an array in Pipedrive (List Product in Deals). Since Pipedrive doesn’t have a function to provide an overall discount, we created a product called “Discount” for that purpose. I would like to calculate the percentage discount every time this product is included in a deal. However, I need to filter out this specific product from the bundles. How can I do that and include the percentage discount on an invoice?
here is an example, the bundle 3 is the discount. With this data, I then create invoice items, but I would like to filter out the “Sonderrabatt” and insert the calculated percentage discount into the “discount” field in the invoicing tool.
Not sure, if the sum is the correct discount value that you want to grab but you can change it to other value if required.
You can use this formula to calculate the discount for line items as required in the aggregator mapping.
Not sure if this makes sense, but this will be an easier option if this is feasible. What you can do is add two List Product in Deals.
Liist Product Deals, Put a Filter in between, and/or add an array aggregator or set a Variable Module. Filter will be used to pick up the Discount Line Item, you can just do this if name is Sonderrabatt then go to set the variable or array aggregator
Now Keep the rest of the module as it is that you have at the moment, just like do the same List Product in Deals, add a filter in between to remove the discount line item, and do the array aggregator you have at the moment.
Use the result from Step 1 to calculate the discount
I would like to enter the discount on each invoice line item, so I would only need the variable once and not twice like now in this example above. Here you can see what the array aggregator for the invoice items looks like:
Is the Discount item always the first bundle? Or the first item in the List Products and Deals? If yes, then the one above will work just fine regardless of the Get Variable execution, what it does currently is set if there is a discount, and then for other line items it will just use the Set Variable value that you are using on lower route.
No, is unfortunately different, mostly at the end, but can also be at the beginning. So is unfortunately now once the variable with 0 and once with the discount (5000). The aggregator then unfortunately takes the 0 €.