I have a members page in which there are 4 upload buttons connected with 4 document type fields in the dataset where members can upload files. Now I want members to download the files they have uploaded so I created 1 repeater with 4 Buttons linked to separate document fields. Now the problem is supposed for the first time, a member uploads 4 files, and then for the second time, a member uploads 2 files. So as the user has submitted files 2 times there would be 2 items in the dataset and so the repeater will show 2 columns. Now all the buttons in the 1st column will have links because members have used all the four fields to upload files the first time and in the 2nd column, only 2 buttons will have links because the user has submitted 2 files during the 2nd time and so left 2 buttons will be without links.
So, I wanted to hide the last 2 buttons in the second column. I tried to write code for this but it’s hiding all the buttons.
So can someone please help me out that whenever the document field is empty the button is hidden?
$w("#repeater1").onItemReady(($w, itemData, index) => {
let url = itemData.Files2;
if (url) {
$w('#button55').show();
}
else {
$w('#button55').hide();
}
This is the code I wrote. At first, I only did it for 1 button to test if it’s working or not but it’s hiding all the buttons. I also tried URL === “” and undefined but it’s hiding all the buttons.
Inside -----> REPEATER → $item
Outside → REPEATER → $w
$w("#repeater1").onItemReady(($item, itemData, index)=>{
Do not mix it.
@russian-dima I changed the code but it’s still not working. Do I need to add something else also?
$w("#repeater1").onItemReady(($item, itemData, index) => {
let url = itemData.Files;
if (url === undefined || url === "" || url === null) {
$item('#button56').hide();
}
else {
$item('#button56').show();
}
All the buttons are getting hidden.
@shashdigital0
Normaly you can easely find out all your ERRORs by your own → when using → CONSOLE-LOGs.
How?
For example this line seems to be very STRAGE! Why?
Normaly when defining DATAFIELDS → IDs of the defined DATAFIELD starts always → with a lower-case character, but your ID starts with a CAPITAL-letter.
let url=itemData.Files;
Go to your DB an dcheck it again. Sure that the ID is → “Files” and not “files”?
But what has CONSOLE to do in this situation ???
let url=itemData.Files; console.log(url)
Check CONSOLE of your BROWSER or in the implemented CONSOLE in the Wix-Editor for OUTPUTs.
For example if you are using → google-chrome-browser → press F-12 & navigate to console.
Thanks, @russian-dima . It’s working now. Can you help me with one another thing like I have created custom Wix data forms and now I am trying to automate that whenever a visitor submits the form they will receive a thank you email so I was setting up automation in my Wix dashboard there I selected Wix data forms under select an app and then under choose form I selected any form then I enabled sync contact list toggle and now when I am matching the email field it’s only allowing me to select form field only for one page and not for all the pages where I have added the form so the automation is only working for one page and not for all the pages. So can you help me with this?
@shashdigital0
This is a new issue → please open a new post.