Help me!

Okay - i am creating a customer service internal dashboard, so the staff can submit forms, access features etc.

I need to be able to show data submitted by the user logged in only to that user in a table…

I need the form to put the user who is logged in as the user who submitted the form, this would go into the database but how would i do this?

That’s all for just now

Hello Robert,

From your message I can assume that you have a working form and can submit data to collection, but just in case I will leave this one here: Velo Tutorial: Creating a Form to Store User Input in a Database Collection | Help Center | Wix.com

So, let’s jump right to displaying data to its owner. You can achieve this functionality by using these modules:

Let’s say that we submit data on one page and after submission was successful we redirect user to another (“success”) page.
In our success page we have to add dataset, element in which we will show data and a few lines of code:

import wixUsers from 'wix-users';
import wixData from 'wix-data';
//Note that you do not need to import wix-dataset

$w.onReady(function () {
	let userId = wixUsers.currentUser.id; //Get unique user ID         
	
	//Set dataset's filter to display data based on user ID
	$w("#dataset1").setFilter( wixData.filter()
  		.eq("_owner", userId)
  	);	
});

To put it in words, after site is ready we get user’s ID and filter our dataset based on that value. Data which is being displayed using filtered dataset will return only those records which belong to logged in user.

I hope this will help! Let me know if you have any questions.

Wow - that is brilliant thanks so much!!!