Hi everyone,
I am trying to add two new students from this page into the “students” field of my dynamicDataset.
The line " currentStudents = {currentStudents} {newStudent1} {newStudent2}
; "
is giving me an error “unexpected token ;” but when I remove the ;, I just get another error.
Does anyone see the problem?
import wixData from 'wix-data';
$w.onReady(function () {
const clubDataset = $w("#dynamicDataset");
let currentStudents = clubDataset.getCurrentItem().students;
const memberDataset = $w("#1425MembersAccount");
let newStudent1 = memberDataset.getCurrentItem().nameOne;
let newStudent2 = memberDataset.getCurrentItem().nameTwo;
$w.onReady(() => {
clubDataset.onReady(() => {
clubDataset.setFieldValues({
currentStudents = `{currentStudents} {newStudent1} {newStudent2}`;
});
});
});
});