So I have a scenario that allow me to randomly pick a number from set variables which are linked to CRM users. The objective is to attribute deals equally between all of them.
The way it is set up now, choses randomly a number between 1 and 4. So sometimes it will pick 3 times the number 4 et 1 time the number 2 for example.
The way I would like, is to pick 1 time number 1, 1 time number 2 etc etc.
Could you upload an example of the output bundle of your first module?
If it is a set of bundles, you could use:
It will give you a integer between 1 and 4, as it is modular, it is also periodic.
In your router, depending on the route, you just have to test if this variable is equal to the route number.
It distributes equally the different input elements into 4 routes.
You could use this principle just after the 1st Pipedrive CRM module (do not use the iterator, in my example, it is just here to transform an array into a set bundles).
ID sales = variable between 1 and 4 related to Pipedrive IDs of the sales that I want to attribute a deal to
Choisi un ID = is the module that will randomly choose a number between 1 and 4 t then conduct to one of the routes.
yes but if I use the set variable in your blueprint then I can have an array with the ID’s.
And I’m thinking maybe I need to use and combination of shuffle(sort) functions to pick up from the arrays but in a specific order. This way it wont be able to pick the same number to times in a raw + would be able to pick from all for numbers if I have 4 deals to attribute?..
so the first module is producing only 1 deal? Then its automatically assigned to a random route? And you need over the course of multiple scenario runs to spread it out evenly between them?
I suggest using a data store to store which route got the last deal and then exclude them in the following runs. Once all 4 have gotten a deal each - reset the data store. Or something there of for X amount of deals each, you can add an incrementor and when it reaches a certain amount - that route cant be taken any more until all are equal and its reset.
Hi @Stoyan_Vatov, thank you for your answer.
Actually the module can produce from 0 to a 100 deal each run, it will depend on how deals are in the pipeline at this moment.
The datastore could work, but it’s really not optimal since I don’t know how many deals I will have.