Add new lookup entries

By: Rudi JvR | Asked: 05/14/2023
ForumsCategory: General questionsAdd new lookup entries
Rudi JvR asked 1 year ago
Hi there! I have a capture form for distinct attributes, and also pulling additional values from various other lookups. Is it possible to allow users to capture new Lookup values if not available in the current Lookup list. In other words, Select an existing value from a dropdown list - Or - Capture a new entry to be published to the Lookup table as well as the current capture form? Thanks in advance
Rudi JvR replied 1 year ago

I could even do with using a dynamic field lookup of existing values for the Field in the capture form - If a NEW value is required, allow the user to capture it rather than forcing to select from the lookup list.

1 Answers
Victor Font answered 1 year ago
You can update any lookup table with custom code if you are capturing an "other" option. First, you need to use the "Other" option is enabled if it's available on your dropdown or radio button field. If the "other" option isn't available, use a standard text field as the "add_new" field. Keep the ext field hidden and trigger it with an "Add new" button or link. This of course will save the new value with the form entry. To write it to a lookup form, you have to insert it into the lookup table with custom code executed in the frm_after_create_entry hook.
Victor Font replied 1 year ago

You also mentioned dynamic fields. As you design your process, keep in mind that dynamic fields don't store textual values in the form entry where it's being displayed. The field on the linked form stores the dynamic record's entry id. With an add new option, the dynamic field hasn't been created yet. It's not created until after the user form entry.

This means to keep the user entry in sync with the dynamic lookup, you have to write the new dynamic row entry id to the user form dropdown. Otherwise, it won't work correctly when viewing the entry.

Because of the bilateral transfer, this is a lot to test when writing custom code. If you need the help of an experienced developer, please visit https://formidable-masterminds.com/developers-directory/

Rudi JvR replied 1 year ago

Thanks Victor - I wasn't too sure what the difference was between Lookup and Dynamic fields. In my use case Lookups seems to be what I require. I will research a bit to see if I can figure out how to implement the "custom code" to insert new values to the lookup table.

This seems like functionality which should be available in a form tool like Formidable Forms without the need of custom coding, a bit disappointing 🙁

Victor Font replied 1 year ago

Maybe so, but it's not a common request. I've been answering questions in Formidable forums for over a decade and your question has been asked only a handful of time. I suggest you open a "feature request" ticket with Strategy 11.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right