Hide a button if no document in database

Hello. New to WixCode. I have a “Speaker Info” database with a Document field type that allows speakers to upload their presentation. Field Name is Related Docs, field key is relatedDocs. Not all speakers will upload a document. I have a regular page set up to display speaker information, including a button for their presentation. How do I hide the button if there was no document uploaded?

Thanks for the newbie help. :slight_smile:

Hi Shelly ,

First, you need to get the currentUser ( id ) so you can query the id of that user to find/Check whether the relatedDocs has data/document or not. Finally, do the .hide()/.show() based on that check.

links will help you :
1- getCurrentUser
2- Query

GoodLuck,
Mustafa