How to save output value in wix database?

I’m sure somebody else already asked this but I tried to look it up and couldn’t find anything that worked. I know how to save inputs to database, but I would like to save the result calculated as well.
Can anyone help? Send a link to a tutorial or an answer given to a simillar problem?

For data set :
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFieldValue

For saving directly to the collection:
https://www.wix.com/corvid/reference/wix-data.html#save