Custom Fields: how does this actually work?

I’ve looked thru the documentation, but I can’t for the life of me figure out how Custom Fields actually works in the Custom Wizards. Where are these custom fields stored? How are they accessed? How does a user set a custom field via the form?

Use case: We created a Boolean custom field in the Wizard called: has_reviews. We Serialized it (no idea what that actually does) to topic_view topic_list_item. Then on the action for a form, we mapped it ( What does mapping do anyway? ).

But we don’t see that custom field anywhere on the form nor in the post. How does the form register a value for that custom field and how do we access that value? How does it get into a post? We ran an API request to the topic we created from the form, but the custom field doesn’t show anywhere.

My impression was that custom fields allow you to add fields to a topic or post, but that doesn’t seem to be the case, as there is no way to actually access those fields in any way, or set any values. So I’m confused how this even is supposed to work.

I looked at this plugin: GitHub - pavilionedu/discourse-topic-custom-fields: Discourse plugin showing how to add custom fields to Discourse topics and apparently it allows you to edit the custom field on the topic itself. Does this plugin need to be installed also to use custom fields with the Wizards plugin? If not, then how do you access or set values for the custom fields in the Wizard? How do we get the fields into the Composer when user creates a post or fills in a form?

Thanks.

Thanks Sam for the great question. I confess that I’ve never really understood them either, and you are right - it isn’t well explained in the documentation.

Our @development_team is under a lot of pressure at the moment, but we really need their expertise for this. We’ll need to be patient I’m afraid.

Once we understand I’ll aim to have a clear explainer in the documentation.

1 Like

Hey @osseodent and @NathanK, I’ve made a little video demonstrating how custom fields in the Custom Wizard Plugin work

https://www.loom.com/share/5175c4fa58b9461abad3e3eabe16d787

(@NathanK feel free to put this somewhere in the docs!)

3 Likes

This is awesome! thanks so much. Going to try to use this now.

Just used this video to create some custom fields and works well. My only follow up question is: How do you edit the value in a custom field? If you assign a custom field to a wizard, e.g. a Price to the Product per the video example, how do you edit this price afterwards for that product? Editing the title and description is easy on the actual topic, but there seems to be no way to edit the price field value after submission. THanks.

1 Like