Hi everyone,
I have a giant nested if statement that would require a ton of ifs. Does anyone know a better alternative to doing it rather than this. Regardless having such a big if statement isn't allowed anyway.
Here is an example of one of the ifs that would continue for different users/banks etc.
If(emailToDropdown.Selected.Title = "fName lName" && bankSelectionDropDown.Selected.Title = "Bank" && userSelectDropDown.Selected.Title = "DS" && bankAccountTypeDropDown.Selected.Title = "Transactional" && accountOptionDropDown.Selected.Title = "Open an Account",
Launch("mailto:fName.lName@email.com" & "?subject= New account opening Bank" & "&body=Hi fName," & "%0A" & "%0A" & "In connection with the new account opening at Bank, attached please find account opening documents submitted for signature." & "%0A" & "Bank accepts docusign" & "%0A" & "%0A" & "Please let me know if you have any questions regarding this request." & "%0A" & "%0A" & "Kind regards"),
Solved! Go to Solution.
Hi @FlatFish
An alternative would be to store your email message templates in a table. This could be in an online data source like a SharePoint list, or it could be a static Excel file that you import into your Power App.
This table would include user and bank columns, and you would use those details to uniquely identify the message text.
From the button where you currently launch your email, you would call LookUp on this table to lookup the message text template, rather than construct the message text using an If.
The message text that you store in this table could contain placeholders such as "{fName}" and from your formula, you could call the Substitute function to insert the actual data values.
Hi @FlatFish
An alternative would be to store your email message templates in a table. This could be in an online data source like a SharePoint list, or it could be a static Excel file that you import into your Power App.
This table would include user and bank columns, and you would use those details to uniquely identify the message text.
From the button where you currently launch your email, you would call LookUp on this table to lookup the message text template, rather than construct the message text using an If.
The message text that you store in this table could contain placeholders such as "{fName}" and from your formula, you could call the Substitute function to insert the actual data values.
Thank you for the reply Tim. That makes sense and will be most likely what I do.
You're welcome @FlatFish - the other benefit of storing the template text in an online table is that you could modify the message text without needing to republish your app.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
192 | |
67 | |
46 | |
41 | |
22 |
User | Count |
---|---|
246 | |
120 | |
83 | |
76 | |
70 |