Flow designer Max results

Annika Aaltonen
Kilo Guru

Does anyone happen to know, are the records returned when using Flow designer's Max results -tool completely randomised? Let's say100 records match my lookup, but I want to return only 5, is there any kind of logic on which 5 are returned, or is it fully randomized each time?

TIA

Annika

1 ACCEPTED SOLUTION

Thanks Mahak,

 

Actually my requirement is to generate a completely random sample, so I wouldn't want to sort nor order by anything.

I did some tests, and if I leave 'Order by' empty, and run a lookup, it will by default return the matching records by age/created.

Basically I do not want the exact same records to be returned if I run the lookup twice in sequence, but each time a new randomized sample.

I suppose I need to play around with the conditions here, as this lookup would be run once a month, so I can add 'created last month'. Then different records would be returned either way. 

 

Thanks,

Annika

View solution in original post

3 REPLIES 3

Mahak2
Kilo Guru

Hello Annika,

In general you can use order by and sort field to do sorting on the records you get after doing look up records.

If you want to add specific  filter condition then you can refer below article:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0820110

https://community.servicenow.com/community?id=community_question&sys_id=741513a3db7b67c4feb1a851ca9619bf

 

 

Please mark my response as Helpful and correct if it solves your query.

Thanks

Thanks Mahak,

 

Actually my requirement is to generate a completely random sample, so I wouldn't want to sort nor order by anything.

I did some tests, and if I leave 'Order by' empty, and run a lookup, it will by default return the matching records by age/created.

Basically I do not want the exact same records to be returned if I run the lookup twice in sequence, but each time a new randomized sample.

I suppose I need to play around with the conditions here, as this lookup would be run once a month, so I can add 'created last month'. Then different records would be returned either way. 

 

Thanks,

Annika

Yes Annika in that case please update the conditions to get the desired result.

 

Thanks,

Kindly mark my response helpful/correct in case it helped you.