show database content in input fields

Dear all,
I’d lie the input fields to show the content that has already been entered by the user.
To be specific, I’m talking about a user page. The user enters data, that then is send and stored in a database. When the user wants to change some of his data (e.g. location etc.), he then goes back to this page. It’ll be nice if the input fields then show his content, so he can change it.

I know how to send/store data to the database. I know how to retrieve and show this data. However, with the functionality in WIX I can only to one of those things at a time.

$w.onReady(function () {
const fullName = local.getItem('title');
const about = local.getItem('price');
const referralCode = local.getItem('class');
const teslaModel = local.getItem('days');
const latitude = local.getItem('days');
const longitude = local.getItem('days');
$w('#input1').value = fullName;
$w('#input2').value = about;
$w('#dropdown1').value = referralCode;
$w('#location').value = teslaModel;
$w('#latitude').value = latitude;
$w('#longitude').value = longitude;
});

I tried to apply the following corvid code to show the values already entered, but no change is shown to before. Does anyone have an idea on that?
Many thanks,
Constantin

PS: Currently, the input fields now would overwrite the entire content, when resumitting data. Meaning, those input fields that are left blank erase the previously added content,

Hey @constantintrautmann !

Are you familiar with Wix’s Datasets ?
It gives you the ability to connect your site elements directly to the database and write/present/edit the data without any efforts!

Let me know if it solves your query. Also, if you don’t use datasets on purpose, let me know why and what’s the use case and we’ll try to find another solution for ya’!

Doron.

Dear Doron, many thanks for your reply. Yes, I’m familiar with datasets. My understanding is that I can either pull data from the database, -or- send to the database. For my application, I need to do both (before saving, show the already saved data in the input fields). I therefore thought I need to cover ‘pulling the data’ using corvid.

I hope I could express me clearly :).

Constantin

Wouldn’t ‘Read-write’ mode be sufficient then?
It gives you the ability to present the data item and also update it.

The only thing is that the initial submission needs to happen using a ‘Write only’ dataset since a ‘Read-write’ will break the flow (No item to present).

Doron.