Difficulties setting properties of email query component

This seems basic, but I can't override the design-time properties of an email component, e.g. fromEmail, body, and so on. The code below, attached to the click handler of an action on a table component, executes without error but doesn't set the property values. The email goes out with the properties set at design time. What am I doing wrong?

// address obscured for privacy
console.log('email click handler');
SendEmail.fromEmail = 'c...@....com';
SendEmail.toEmail =
SendEmail.body = 'You have been assigned a request by the ... Committee';
SendEmail.subject = '... Committee volunteer request';

Just a bump. Anyone have ideas?

Hi @edwardhamlin Thanks for reaching out!

Query & component properties in Retool generally cannot be set with propertyName = "some new value".

Instead, you need to use Retool methods. For example, using .setValue to update a component's value:

For the email query, I'd recommend using additionalScope to pass values into the query when it's triggered. In order to use additionalScope, you also have to add these dynamic variables to the email query. The values will be red/undefined because they won't get defined until you trigger your additionalScope event:

Let me know if this approach works for you!

1 Like