I have a form with a text input field that I would like to use as the subject line when sending an email. I feel like I have the correct answer but it doesn't appear to be working. Here is my sample code:
Office365Outlook.SendEmailV2(
"myemail@email.com",
"Downtime - " & DowntimeType.Text,
varEmailMessage,
{Importance: "High"}
);
ResetForm('Downtime Form');
No errors are being thrown but it doesn't add the input from DowntimeType.Text. The email I receive has the subject line as "Downtime - " and nothing else. I've also tried using Concatenate to no avail. I don't work with forms often so maybe it has something to do with the fact that the input is within a DataCard?
Yes - embrace the Allowed Values type whenever you need to make a text field a dropdown. I was going to suggest that one at first for you, but it does only add a dropdown and you wanted searching - which is a combobox.
There is a lot of stuff already built in to forms that I see many trying to re-create on their own.
Good deal though on everything working now though!! And now your emails will have a good subject line! 😁
I attempted to do that at one point but it was still displaying it as a text input for some reason. When I went to change the control type it didn't give me the option to make it any sort of dropdown. The closest it had was "Allowed values" but I didn't really know what that meant.
I went ahead and just removed the form and re-added it. This wired everything up correctly and it's now working properly. I'll be marking the "Self.LastSubmit" comment as the solution since that's what ultimately worked once my form was no longer broken.
Thanks Randy!
You will not need to go that far. But, if you did change the type from text to Choice in your list and you already had this form in your app with the text, then you will need to remove that field from the form and add it back.
When you do, it will automatically have a dropdown in it. That is easily changed, however the DefaultSelectedItems property will need adjustment.
I will need the ability to search but not multi-select. What I might try is just removing the form and re-adding it to see if it will work, that will probably be the easiest solution.
Another question then...is there any need for a combobox as opposed to a dropdown? The only value the combobox brings to the table is (beside being more complex to get what you want to work), searching and multi-select ability.
Do you need either of those features on this?
Sorry for the confusion.
DowntimeType - name of the combo box within Downtime Type_DataCard2
Values within this combo box are appearing properly from the SharePoint list where the column is called "Downtime Type" and of type Choice.
Items property - Choices([@'MyList'].DowntimeType)
As for changes I made, it's tough to say exactly. I went into my SharePoint list and changed the column from single line of text to Choice, and added some sample choices. Went back to my Power App and refreshed my data source. Removed the text input field from the data card and added a combo box instead. Went through the error marks and thought I wired it back up correctly but it appears that isn't the case.
To clarify -
DowntimeType is the name of the dropdown control in your form datacard?
The value you are trying to submit from the dropdown is in your choice column?
The items property of the Dropdown control is: Choices(yourList.'Downtime Type')?
Tell me about any customizations you have made to the "Downtime Type" datacard when/after you added it to your form.
Yep! There's the issue.
What is the Update property of the datacard that contains that control?
No error is thrown, but it still doesn't come through correctly. I'm also noticing that it's not actually saving the value to the SharePoint list either. I wonder if that's indicative of what the actual problem is.
WarrenBelz
146,587
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional