My clients have asked for the ability to download a list of Guild Members to EXCEL. This is in a collection that I created. I read the following post and I currently am able to download the collection with code.
https://www.wix.com/corvid/forum/corvid-tips-and-updates/how-to-download-the-contents-of-a-data-collection-in-a-csv-file/p-1/dl-5e5745e242f3b900185ffbd8
T he download is not in the correct order and has system fields that I would prefer to hide from the clients. Is there a way within this code to order the fields and to pick and choose which fields I would like to include. I am using the code from the above post exactly as is with no modification.
TIA
Diane
Yes, I remember that post from good old Steve. First, about the order, add “ascending/decending” plus field name to the query (see docs on wix-data, queryobject). This returns a complex object (like any other query), but the one you are interested in is the ,items-array, Isolate it into a var, so you will only have the data. Now you have several possibilities to “strip” unwanted fields. To prevent any cloning problems, I would suggest you build a for-loop where you read the source-row and then copy the “needed” fields into a new array, etc (let´s call it newResult).
And then, instead of passing the loadPage(result), you pass newResult. Should do the trick.
Thanks so much!! I am new to coding but will try coding. Love a good challenge!!