Hello Ayush Awasthi,
yes i would say, it is possible.
For example you have a database-A where you have write-permissions and the users only read-permissions. Before I start writing a novel, here take a look at this example here, it might help you…
https://russian-dima.wixsite.com/meinewebsite/switch-safe-function
Well the site is under construction, but i will put an example-code here:
import wixData from 'wix-data';
//------------------------------------ USER-DATA-INTERFACE -----------------------------------------
//var DATABASE = "Switch-Save-Function"
var DATASET = "dataset1"
//------------------------------------ USER-DATA-INTERFACE -----------------------------------------
var currentItemIndex
$w.onReady(function () {
$w("#"+DATASET).onReady( () => {
$w('#TXTmember').text="Member-"+currentItemIndex
$w('#BTNsave').onClick(()=>{
if ($w('#BTNswitch1').checked===true){$w("#"+DATASET).setFieldValue("btnStatus", true);}
else {$w("#"+DATASET).setFieldValue("btnStatus", false);}
$w("#"+DATASET).save();
})
$w('#BTNnext').onClick(()=>{console.log("NEXT")
currentItemIndex = $w("#"+DATASET).getCurrentItemIndex()+1
console.log(currentItemIndex)
$w('#TXTmember').text="Member-"+currentItemIndex
})
$w('#BTNprevious').onClick(()=>{console.log("PREVIOUS")
currentItemIndex = $w("#"+DATASET).getCurrentItemIndex()+1
console.log(currentItemIndex)
$w('#TXTmember').text="Member-"+currentItemIndex
})
})
});
This example shows, how you could save data in your database. So if a user accidently REFRESH his site, the saved data will be still available.