I am trying to build a multi-sided platform for two different users. User A will need to be able to upload a document they created with the aim of selling copies of that document. User B will need to be able to search for a document (uploaded by User A). If the document exists, User B will need to be able to pay for a copy of the document and download it. If the document does not exist, User B will need to be able to complete a form and provide their details.
I have set up the first part of the website for User A by creating a form (user input elements) and connecting it to a data collection. This enables User A to provide some basic details and upload a PDF copy of the document. I now need to create the functionality for User B but I do not know how.
What is the easiest way for User B to search the data collection? I then need two options depending on the search result - either pay for a copy of the document (positive result) or complete a form (negative result).
Please note: I do not wish to display the documents uploaded by user A on a single page for User B to search for. I simply want User B to be presented with a search box and then to be presented with one of two pages depending on the search result.
Any help would be gratefully appreciated.
Thanks,
Paul
You wanted to search for something in your DATA-COLLECTION.
Take a look into this post here...
https://www.wix.com/corvid/forum/community-discussion/checkbox-is-not-integrated-code-editing-help
I am very new to coding so I'm not familiar with the terms you used. All I want to do is to search my database without displaying all results and without it looking like a crappy table.
What is the diference between "search" and "filter"?
The usage of utilized elements?
using DropDowns = Filtering?
using InputFields = Searching?
But the proces should be the same, or not?
So replace the DropDowns and use inputfield instead.
Thanks for your reply. I would like users to be able to search rather than filter.
If you want to filter date in a Data-Collection, then you have a choice of 3 different ways, how to do it.
1) Without code --> by using the given UI by wix.
2) Code-version-1 ---> using a DATASET and filter by dataset.
3) Code-version-2 ---> using DATABASE without any dataset.
The most flexible way is of course the last one, but also the most difficult one to program.
Here you will find a simple example, by using a DATASET.
https://russian-dima.wixsite.com/meinewebsite/blank-3
And here you will find one more upgraded and more challanging-FILTER-version....
https://www.media-junkie.com/pflegeservice
Read the belonging forum-posts, to understand all the coding.
This is an example by using a dataset-filter...
import wixData from 'wix-data'; export function A_change(event) {setMyFilter()} export function B_change(event) {setMyFilter()} export function C_change(event) {setMyFilter()} export function D_change(event) {setMyFilter()} export function E_change(event) {setMyFilter()} export function F_change(event) {setMyFilter()} export function G_change(event) {setMyFilter()} $w.onReady(function () { }); function setMyFilter (parameter) { let REFERENCE1 = "columntitle1" let REFERENCE2 = "columntitle2" let REFERENCE3 = "columntitle3" let REFERENCE4 = "columntitle4" let REFERENCE5 = "columntitle5" let REFERENCE6 = "columntitle6" let REFERENCE7 = "columntitle7" let ITEM1 = $w('#A').value let ITEM2 = $w('#B').value let ITEM3 = $w('#C').value let ITEM4 = $w('#D').value let ITEM5 = $w('#E').value let ITEM6 = $w('#F').value let ITEM7 = $w('#G').value let filter = wixData.filter() if ($w('#A').value!==0) {filter = filter.eq(REFERENCE1, ITEM1);} if ($w('#B').value!==0) {filter = filter.eq(REFERENCE2, ITEM2);} if ($w('#C').value!==0) {filter = filter.eq(REFERENCE3, ITEM3);} if ($w('#D').value!==0) {filter = filter.eq(REFERENCE4, ITEM4);} if ($w('#E').value!==0) {filter = filter.eq(REFERENCE5, ITEM5);} if ($w('#F').value!==0) {filter = filter.eq(REFERENCE6, ITEM6);} if ($w('#G').value!==0) {filter = filter.eq(REFERENCE7, ITEM7);} $w('#dataset2').setFilter(filter) } $w('#viewresults').onClick(async(event) => { await setMyFilter().then(() = { // Refresh the dataset $w('#dataset2').refresh(); }).then(() = { // Repopulate the repeater's data $w('#repeater1').forEachItem( ($item, data) => { $item('#text89').text = data.columntitle8; $item('#text88').text = data.columntitle9; }) }) })
Good luck, happy coding and a happy new year!😀