1
votes

When I utilized FormFlow, I have the following for a field:

public enum Categories
{
    [Describe("Inquiry / Help")]
    InquiryHelp = 1,
    [Describe("Audio / Video & TV")]
    AVandTV,
    [Describe("Consulting & Data Analysis")]
    Consulting,
    [Describe("Email / Calendar & Collaboration")]
    Email,
    [Describe("IDs / Accounts & Access")]
    Accounts,
    [Describe("Network Services")]
    Network,
    [Describe("Phone Services")]
    Phone,
    [Describe("Radio & Microwave Services")]
    Radio,
    [Describe("Security & Policies")]
    Security,
    [Describe("Servers & Data Storage")]
    Servers,
    [Describe("Software & Business Applications")]
    Software,
    [Describe("Tech Support & Training")]
    TechSupport,
    [Describe("Websites / Design & Hosting")]
    Websites
}

[Optional]
[Describe("the appropriate category")]
[Prompt(new string[] { "Please select the appropriate category for your problem (optional)." })]
public Categories Category { get; set; }

When the form is run, it looks like the following:

Bot with no enum choices

If we remove the Prompt attribute, it will show all the categories:

All the categories being shown

Why can't the Prompt attribute work with enums?

1

1 Answers

3
votes

Your prompt is missing the {||} pattern element. It should be:

[Prompt("Please select the appropriate category for your problem (optional). {||}")]