Hi
I need to create a page to for user themself to see only the Dynamic Repeater with only the data they have inputed before.
I know there is a field called _owner, but i hv no idea how can i do the coding to filter the page only show up data with their own (_owner)?
Its different with filtering something contain a specific words, i will need the to filter which one contact the variable which is the member's own membership ID.
I hv very new for coding, hope someone can help.
hay rol,
how to filter on multiple reference._id results
Still unsure wt are the steps.
I need to create a page for members shows up dynamic table with the data they input before, so i need a dynamic page link. Can anyone help plz?
Hi,
By member id I meant user id.
For more information:
https://www.wix.com/code/reference/wix-users.html#currentUser
Do you have members database collection ?
Roi
Hi Roi, I cannot understand what it means. Before this coding, do i need to create a new item named "Member" in the database table?"
Hi,
My suggestion is to take the next steps:
1. Get the current member id (assuming that the member id and the item id are matched).
2. Query the member's item (row in the database collection)
3. Set filter to the dataset
Here is a sample code:
import wixData from 'wix-data'; import wixUsers from 'wix-users'; $w.onReady(() =>{ let user = wixUsers.currentUser; let userId = user.id; wixData.query("Members") .eq("_id",userId) .find() .then((results) => { const firstItem = results.items[0]; const ownerId = firstItem._owner; $w("#myDataset").setFilter( wixData.filter() .eq("_owner",ownerId) ); }); });
The other option is to wait for the release of this feature is the editor ( in the near future).
Good Luck!
Roi
thx Or
I need to create a page to for user themself to see only the Dynamic Repeater with only the posts they have inputed before. Its
Hi,
Can you please clarify what is the use case? What are you trying to achieve?
You can share the code you have so far.
I hv already learnt how to create Dynamic page.
Its easy
My question is abt filtering
Hope someone can help
Hi,
Sounds like a Dynamic Item page is the best solution for you.
https://www.wix.com/code/home/tutorials-dynamic-pages
Feel free to paste your code here
Roi