In my SPFx web part below I get items from a list. That works fine.
What is the best way to randomise the results that come back?
I tried to do r = r.shuffle(); but I think I am way off.
Thanks P
if(typeof this.properties.filterByPosition !='undefined' && this.properties.filterByPosition)
camlQuery += "<And>";
camlQuery += "<Eq><FieldRef Name='department'></FieldRef><Value Type='Text'>" + this.properties.groupName + "</Value></Eq>";
if(typeof this.properties.filterByPosition !='undefined' && this.properties.filterByPosition)
camlQuery += "<Eq><FieldRef Name='jobTitle'></FieldRef><Value Type='Text'>" + this.properties.filterByPosition + "</Value></Eq>";
if(typeof this.properties.filterByPosition !='undefined' && this.properties.filterByPosition)
camlQuery += "</And>";
camlQuery += "</Where></Query></View>";
//if(typeof this.properties.filterByPosition !='undefined' && this.properties.filterByPosition)
const r = await sp.web.lists.getByTitle("UserData").getItemsByCAMLQuery({
ViewXml: camlQuery,
});