Jump to content

Returning Random Creatives of a set Qty


rgreenidge

Recommended Posts

I have a job that has four different coupon values, 10% off, 20% off, 25% off, and 50% off. Each value requires an exact number of coupons for example:

 

10% off - 1,000

20% off - 250

25% off - 300

50% off 100

 

I need to compose a file that randomly uses the coupon values with the exact amounts required. Is this something that is possibly in Fusion Pro.

 

Thanks in advance.

Richard.

Link to comment
Share on other sites

I have a job that has four different coupon values, 10% off, 20% off, 25% off, and 50% off. Each value requires an exact number of coupons for example:

 

10% off - 1,000

20% off - 250

25% off - 300

50% off 100

 

I need to compose a file that randomly uses the coupon values with the exact amounts required. Is this something that is possibly in Fusion Pro.

Sure. You just have to set the repeatRecordNumber to the quantity for each unique coupon in an onRecordStart callback rule.

Link to comment
Share on other sites

Sure. You just have to set the repeatRecordNumber to the quantity for each unique coupon in an onRecordStart callback rule.

 

Yes, but don't forget it needs to be randomized.

 

I can do a random generator without a data file as such :

 

myLimit=[1000,250,300,100]; // being maximum repeat count for each coupon

 

for (var i=1;i<=1650;i++) { // loop thru all 1650 coupons

 

do { choice=Round(Math.random()*3, 0); } while (myLimit[choice]===0) ; // pick one of the 4 coupons

 

if (choice==0) { coupon="10.jpg";myLimit[0]=myLimit[0]-1; };

if (choice==1) { coupon="20.jpg";myLimit[1]=myLimit[1]-1; };

if (choice==2) { coupon="25.jpg";myLimit[2]=myLimit[2]-1; };

if (choice==3) { coupon="50.jpg";myLimit[3]=myLimit[3]-1; };

 

}

 

return coupon;

 

 

But I do not know how to generate a record each time it goes through the loop...

 

Anyone??

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...