Introducing Experimental Form Templates

A post was merged into an existing topic: Setting Form Templates with a tag

Iā€™m trying to build quite a long one to replace a Category Template.

But Iā€™m getting an error that its too big:

However, this setting is set higher:

Is this not the same thing, or is this a bug?

I scanned the code briefly, but couldnā€™t find the answer.

I feel 5,000 is a little restrictive, can we double it or make it its own setting?

Oh I see now, itā€™s an Active Record error, and the original migration is here:

3 Likes

Iā€™ve used regular templates for things and while I find the feature more useful than not having a template, the resulting formatting always looks off because itā€™s not clear how to enter the data.[1] So having a custom form is great!

Feedback:

  1. I really miss having links. (And to a lesser degree, Markdown formatting.) If people donā€™t know what an option means, it would be handy to point them at the documentation. [I believe this and the next point are addressed by Introducing Experimental Form Templates - #64 by Tris20]
  2. Iā€™d like to have a way to add instructions or an introduction. Ideally with links. :wink:
  3. The title of the post and tags seem to be part of the form. Itā€™s awkward that we canā€™t customize the prompt. In this form, Iā€™d like the proposed group name to be the title, but itā€™s not clear how to signal that to users so I added a redundant field:
  4. In the same vein, itā€™d be interesting to include some way to prompt people to use specific tags. For instance, a support system might use tags to help triage a ticket. The form could include a dropdown with the relevant tags and automatically apply it to the topic. Maybe the same thing with categories too.
  5. Itā€™s not immediately obvious that the multi-select allows more than one choice. You need to know to use Control or Shift to select more than one, from what I can tell.
  6. Itā€™d be neat if checkboxes where represented as checkboxes[2] in the resulting post:

    Is the box checked?

  7. Trying to submit a blank form does nothing and doesnā€™t show an error. (In fairness, I could add a validation or two to fix this.)

On the whole, this feature really does check a lot of boxes[3] for my purposes. (Iā€™m working on a way for people to propose new groups on my community-building platform.)


  1. The Ask Wizard on Stack Overflow started life as a very crude tamplate. My experience with that colors the way I look at this feature in general. Iā€™ve also used the current Discourse template system for an essay feedback system. ā†©ļøŽ

  2. At the moment itā€™s a heading with either ā€œonā€ if the box is checked. ā†©ļøŽ

  3. Heh! ā†©ļøŽ

4 Likes

Oh. I just noticed the form input isnā€™t saved as a draft. If you close the draft, the topic title is saved, but not anything in a text box or input. Ugh.

2 Likes

I got feedback elsewhere and meant to follow up on this, thanks for the nudge :slight_smile:

So to set up ToS checkboxes with links to terms you can do something like

- type: checkbox
  id: read-chatgpt-guidelines
  attributes:
    label: "I have read and I agree to the latest ChatGPT guidelines"
    description: '<a href="https://discourse.company.com/t/current-gpt-and-bing-guidelines/4348"> Click here for the latest ChatGpt Giudelines</a>'
  validations:
    required: true   
- type: checkbox
  id: accept-workspace
  attributes:
    label: "I will not use the @workspace command in customer project if I am using Github Co-pilot"
    description: '<a href="https://discourse.company.com/t/for-compliance-reasons-the-workspace-command-must-not-be-used-in-customer-projects/4371">Click here for details about @workspace command</a>'
  validations:
    required: true        

Which looks like this:

image


This is also the only pain point I have with Forms at the moment. Itā€™s just a bit un-intuitive for users, and being able to auto-populate the title would be very helpful.

5 Likes

Yes this works. The description field might be what I need to serve as introduction/instructions too. Thanks for the tip!

4 Likes

As Tristan said above, it would be very useful to me to be able to populate the topic title from the form responses.

So if we had a form where users could submit their bio and whether they are a dog or a cat lover, we would like the topic to show up as ā€œCat-lover bio: John Smithā€ or ā€œDog-lover bio: Ralph McLeashā€ etc.

This is a really great feature! Is it still classed as experimental? Iā€™m currently using an external form that posts by email to my forum, and Iā€™d love to replace that with this, if thereā€™s a sense that itā€™s going to stick around long-term.

4 Likes

Iā€™m trying something where I use a checkbox to tell people how to fill in the title. Itā€™s not ideal, but I think itā€™s the best alternative we have right now:

Screenshot 2024-02-19 at 8.38.10 PM

3 Likes

Just started playing around with this. First impressions: very nice! Thanks!!

As this expands, I would love to see:

  • Conditional fields, i.e. the text fields some forms add when you choose ā€œOtherā€ from the list of options.
    My specific case: If from the dropdown, you choose SonarQube, I want to then prompt you for its version

  • I would also love to be able to pull the values for a dropdown from some other place, presumably a post.

    Why? Letā€™s go back to the question of versions. Ideally, I wouldnā€™t prompt users to type them in free-form, but would give them a list of versions, latest first.

    The problem with this is two-fold

    • I want to present these lists in multiple different templates
    • versions keep being released

    Which means that with each release, I have n templates to update with the new version number, and hopefully I remember to update all of them. :crossed_fingers:

6 Likes

Our CSS changes (so far) In case itā€™s helpful to someone else:

// remove the grey background
.d-editor #form-template-form {
    background-color: var(--secondary);
}

// stop stretching the fields to 100% width
.form-template-field select, .form-template-field input {
    width: auto;
}

.form-template-field textarea {
    min-width: 650px;
    width: auto;
}
4 Likes

A post was split to a new topic: Renaming screenshots in the composer before posting

Thanks to everyone for the feedback. :slight_smile: Iā€™m going to close out this announcements topic now and encourage anyone with any ux, feature, bug, or support requests for this feature to open a new topic in the appropriate category and pop a form-templates tag on it. :+1:

9 Likes