1

I'm trying to create a function to fetch one or more random entries from my array but I'm having an "illegal call" array_rand error on my flow.

Then I realized that not all PHP functions are supported through GlobiFlow, so I was hoping that there's a workaround for this one.

screenshot:

enter image description here

Here are my variables:

  • choicesval = my array
  • randum = random number from 1 - 7
  • xField = random item(s) that were chosen from my array_rand

Here's the furthest that I got:

explode(",", choicesval)[intval(randum)]

But the problem is, it returns the element from my array based on the index. For example, my randnum got a value of 3, so in my Xfield, it will return the element at index 3 and not select 3 random items from my array.

Hope I'm making any sense at all.

James Z
  • 12,209
  • 10
  • 24
  • 44
Aurous
  • 211
  • 1
  • 3
  • 11

1 Answers1

0

I'm not successful in correcting my error above, however, I've found a workaround to achieve the same result.

I created a new var named limitnum = 0, then a for each loop:

for each item:
        if limitnum <= randnum
              choicesval = [(Ref Client) Company Name]. ", " .[(Variable) choicesval]
              limitnum += 1;
        end if
continue()
Aurous
  • 211
  • 1
  • 3
  • 11