Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

How to grab RANDOM items from list/library?

  Asked By: Ralph    Date: Feb 27    Category: Sharepoint    Views: 2032

Is there any way to use a dataview web part to return just one random
record from a list?

The closest I've found was this:

www.sharepointblogs.com/.../randomly-displayi
ng-a-single-sharepoint-item-on-refresh-i-e-item-rotator.aspx

Which has two rather huge limitations:

1) You have to have 60 items
2) You can't have any gaps in the ID field of the records (ie, no
deleted records).

So, it's not really that useful.

I'd be open to other web parts (either built in, free, or commercial)
but the key is that I need to be able to fully control the HTML output
and which fields I'm grabbing, so this has to be more than an 'ad
rotator' type of thing.

The drawback to the Data View is that it appears to use CAML/XSLT for
the filter and there's no built-in random number generating function for
that.

Any/all suggestions welcome!

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on How to grab RANDOM items from list/library? Or get search suggestion and latest updates.




Tagged: