I have a SPFx React JS web part which populates a grid from SharePoint list. This is working fine. Now, I want to populate a dropdown based on results returned in list. i.e. There is a location dropdown which should populate based on unique values of location returned in result grid.
How can I achieve that please? I wrote a function that would return unique values from result set. But I am not able to call that function in Success() after results are returned. It throws error that function does not exist.
Below is the function :
Hi Avni. I think the problem would be scope of this keyword. Try something like this by assigning this object to a local variable. Below is a sample code snippet.
let thispage = this;
clientContext.load(web);
clientContext.executeQueryAsync(function () {
thispage.functionname();
});
Thanks,
Jayakumar B.
Hi Avni .. could you please send me the code snippet again? the formatting got screwed up.
emai is : mark.jones@collaboris.co.uk