Hello, I need your help, guys ! :) Simple : I want to hide/show text elements if a specific multiple items reference field is empty in the database.
I tried a lot of variants but nothing is working for me at the moment.
Thanks for your help and for your time !
Dear @Yisrael (Wix), any help for us ? :)
The ID alpha-numeric code is the same in MemberProfile and in Members/PrivateMembersData collection (example : 93cf4f5d-a961-4b38-961d-f973b11afbd7) but the name of this ID is different :
> '_id' in MemberProfile
> 'contactId' in Members/PrivateMembersData collection
So here is my code (import wixUsers from 'wix-users'; is at the top of the page code) and still, it doesn't work :(
And when I add .eq("_id", userId), userId is not defined.
I display items "livres" in a repeater, but the initial items are not stored in a reapeater but in the database "livres".
So I have items (books) in my "livres" database + I have a reference fields in my "MermberProfile" database pointed to "livres". And to each current logged in member, I want to display a text message if the reference field "livres" is empty in the "MemberProfile" database.
Where should I paste the console.log exactly in the code ?
I just tried to add the line and still not working. Quite deresperate !
Not working... And as often, when I add a block of code which is not working like this one, all the correct code of my page stop to be executed. I need to remove the failed block of code and everything re-exe correctly. Normal ?
I tried this, not working either :
$w.onReady(function () {
wixData.query("MemberProfile")
.include("livres")
.find()
.then( (results) => {
if(results.items.length > 0) {
$w("#message1").show();
}
else {
$w("#message1").hide();
}
}
)}
Hello Robert ! No, actually, the code is not working with a reference type field, just with a classic text field. So, any help is welcome ! :)
Hey there! Did you not get your question answered in your other post? If not, let me know what is different about this request.