Retrieve the data from a button variable
Hello!
I have a database in which I have a table "Dashboard" which is the page that displays when I open Ninox and another table "Accounts" containing all the contact details of my customers.
When it's my clients' birthday, I manually go to each client's file in the "Accounts" table then I click on a "Birthday" button that I created which sends an email to wish a birthday.
Instead, I would like to have a button on the dashboard that will automatically send an email to all birthday customers. So far, I know how to do it. However, I would like the content of the email to be taken from the button in the account rather than having to re-enter it myself in the button on the dashboard.
Is it possible ?
Example of button:
let title := « Birthday »;
let message := "Do you really want to send the email?";
let answerOptions := ["Ok", "Ko"];
if dialog(title, message, answerOptions) = "Ok" then
let sample1 := (select Accounts);
for loop1 in sample1 do
if loop1.’Birthday’ = true then
sendEmail({
from: loop1.Entreprise.'E-mail',
to: loop1.'E-mail principal',
subject: "Happy birthday",
text: loop1.'Birthday button’.’text_birthday’,
})
end
end
end
Where « text_birthday » corresponds to let text_birthday = "content email" in the "Birthday button" of the Accounts table.
If it is not possible to retrieve the data from a button variable, will it be possible to retrieve the variable from a formula field?
Thanks for your help
6 replies
-
Or you could put the code from the button that generates the text into your loop.
Content aside
- Status Answered
- 9 mths agoLast active
- 6Replies
- 47Views
-
2
Following