I have a wix form for each page where people can vote.
Each page has a project and a countable total vote for each page I have it set to count automatically the vote each project gets.
Now I have a repeater which is a a top chart it collects data from the collection “projects”
Now I want to add the counted total votes for each project to each item in the repeater and allow the items to run based on the number of votes (a project with a higher vote to a project with a low vote.)
can someone help me do this?
Thank you.
Hi,
How does your data look like?
Do you have a voteCount column with the total votes per project?
Hi Tomer,
no no I don’t have that in my data. That’s what im unable to do. I have the total votes count on each page for each project like here www.archbestproject.com/2000 and archbestproject.com/2001 you can see the total votes counts once you vote.
@masohmatic I see you’re counting the number of entries. What you can do instead is have another field (new column) for each project which will be the vote count. Every time a user submits, you update the vote count field value to be +1, with the update API
@tomer-wix so if my voting count field is voteCount ( what type of field should it be number or text etc? ) but if the feid called countVote is it possible to give me codes where I can copy and paste them? I feel like I’m really a step close to what I’m looking for,
@masohmatic The field should be number type. I can’t provide the code unfortunately, start playing around with it, I’m sure after a few tries you’ll make it work 
@tomer-wix Hi Tomer,
So now im using the codes below but its say item means the item in the field. how do i define my item if my item has a (Title) field that has a (text) a name of a project in my case?
Thank you in advance.
// …
let toUpdate = {
“_id”: “2ebd65c9-7a3f-4b16-8827-08f62743510c”,
“title”: “LYNNWAY LEARNING LAB”,
“project”: “2000”,
};
wixData.update(“Projects”, toUpdate)
.then( (results) => {
let LYNNWAY LEARNING LAB <<< ((how do i define each item))= results; //see item below
} )
. catch ( (err) => {
let errorMsg = err;
} );
/* item is:
*
- {
- “_id”: “00001”,
- “_owner”: “ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb”,
- “_createdDate”: “2017-05-24T12:33:18.938Z”,
- “_updatedDate”: “2017-05-24T12:33:18.938Z”,
- “title”: “Mr.”,
- “first_name”: “John”,
- }
*/
@tomer-wix I couldn’t get what im looking for can you please help me