Code works in page but not in dashboard

Hello everyone. I have this code for a notification email that works through EmalJS. It works perfectly in my members area so I am notified when they publish something, however, I tried using it in a dashboard page and has an annoying issue I haven’t been able to solve. Two of three of the input values I have connected to the email variables are not working when I send the email because when I receive it they appear empty, but the third (a dropdown) is perfect. As I said it works good in a normal page but not in the dashboard. This inputs are automatically populated when I click one of the properties in a table I want to check. I already double checked I was connecting them correctly. Please let me know if you need more info on this to solve and thank you for your time.

import { sendEmail } from ‘backend/email’ ;

export function button12_click(event) {

$w( '#dataset1' ).onAfterSave(() => { 

let myprovider = “gmail” ; //use her the alias you used for this service in emailJS
let mytemplate = “wix_gmail” ; //use her the template name you defined in emailJS
let myparams = {
“from_email” : “my email” ,
“to_email” : “my email” ,
“replyto_email” : “my email” ,
“cc_email” : “another email” ,
“subject” : “Inmueble de Miembro Aprobado” ,
“CAUSA” : “INMUEBLE DE MIEMBRO APROBADO” ,
“ID Miembro” : $w( ‘#input5’ ).value, (ARRIVES EMPTY)
“Titulo Inmueble” : $w( ‘#input2’ ).value, (ARRIVES EMPTY)
“Status” : $w( “#dropdown2” ).value, (WORKS PERFECT)
“LINK VERIFICACION” : “” ,
“from_Name” : “Piensa Transversal Finca Raíz”
};
sendEmail(myprovider, mytemplate, myparams);

}) 

}

Hi,

After taking a look at your code, it looks like the reason why those two values are showing up empty may be because of the field key that you entered in your code. They seem to have a space but the field key of a column in your data collection usually doesn’t have spaces between words.
Double check the following field keys:
“ID Miembro”
“Titulo Inmueble”

They may be missing an underscore. You can find the field IDs of the columns by accessing your data collection, click on the column name, click on Properties, and take a look at the Field Key:

If you still encounter the same issue, please send us the name of the site and we will further investigate.

Best Regards,
Edward

Hello @Edward, thank you for answering! The field keys actually refer to the keys of my email JS template. They work great in a normal member page but no in a dashboard page. My site is www.piensatransversalfincaraiz.com
The dashboard page I am talking about it called “Inmuebles por aprobar”.

Please let me know if there is further info you need.