Hello,
I’m facing an issue (might be a BUG) on :MERGE List. I also need your advices to find a better way solving this issue.
I have a data base of 1000 items named KD.
- 900 KD are green (for example)
- 100 KD are red (for example)
I want to show to the user a unique KD list with 10 KD green, 1 KD red, 10 KD green, 1 KD red, 10 KD green, 1 KD red , 10 KD green, 1 KD red , 10 KD green, 1 KD red etc …
To do this:
- I create a User KD List field : “KD Green List”
- I create a User KD List field : “KD Red List”
- I create a User KD List field : “KD FINAL List”
Then I create 2 API Workflows which run in the background:
- User_KD Green List = Do a Search KD which are Green
- User_KD Red List = Do a Search KD which are Red
This works fine and the 2 lists arrive pretty fast
But in the API Workflow I don’t know how to mix the two lists into one as described below (10 Green, 1 Red, 10 Green, 1 Red etc …). I cannot create incremental loop as there is no variable in API Workflow that are required for a loop.
So I have created a standard Workflow “When User Login”
This workflow cherry pick from each list and build the KD-FINAL-LIST thanks to an incremental loop to select 10 KD green then 1 KD Red then 10 KD Green then 1 KD Red… etc…
- CLEAR KD-FINAL-LIST
- KD-FINAL-LIST Add KD Green List Item1: Until:10
- KD-FINAL-LIST Add KD Red List Item1: Until:1
- KD-FINAL-LIST Add KD Green List Item1: Until:10
- KD-FINAL-LIST Add KD Red List Item1: Until:1
It works, but the Problem is it takes a lot of time to go through the whole process (20 to 30 seconds)…
How could I accelerate this and make the cheery pick process running in the background with an API Workflow?
Any idea or recommandation to do this in the background with a smart API Workflow?
WORKAROUND FAIL
I thought the latency might come from an extensive usage of the 3 User_KD-List fields (hard drive access) so I decided to try with 3 CUSTOM-STATES Lists.
But when I use the :MERGE function with CUSTOM-STATES-Lists into a loop it looks like the :MERGE re-initialize the CUSTOM-STATES list every loop … So I cannot :MERGE the CUSTOM-STATES lists in a loop. Is that a bug ? (Believe me I have done a lot of tests…)
Now I have no more ideas and I’m blocked by this issue.
Thanks in advance for your support and ideas…
Best Regards
Pierre