- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 07:31 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 12:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 08:28 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 12:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 07:10 AM
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.