I have a collection “WorkOrders”. I wish to display items in a table from “Work Orders” that match the current users email address to a field in the collection named “customers”.
This table is to sit in a separate members page called “My Work Orders”.
I have used code from a similar article:
why isn't this working???
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import wixData from 'wix-data';
import wixUsers from 'wix-users';
$w.onReady(function () {
let user = wixUsers.currentUser;
let email =...
but I cant get ti to work.
Any help is much appreciated!
David, could you show us your code, that would make it a lot easier?
Hi Giri,
import wixData from ‘wix-data’;
import wixUsers from ‘wix-users’;
$w.onReady(() =>{
let user = wixUsers.currentUser;
let customers = user.getEmail()
.then((customeremail) => {
let userEmail = customers;
wixData.query(“WorkOrders”)
.eq(“customers”, userEmail)
.find()
});
});
@davidlist Hi David!
What are you doing with the query results?
It seems like you stopped half way through.
Doron.
@doron-alkalay oh, this may be where I’m going wrong. I need to display the results in a table.
_or
August 28, 2018, 9:11am
6
@davidlist Hi,
You can display the results in a table with simple coding, check out the API here .