Force the unique value option from a field to prevent duplicate post creation

By: Pablo Tires | Asked: 10/26/2024
ForumsCategory: Code HelpForce the unique value option from a field to prevent duplicate post creation
Pablo Tires asked 4 weeks ago
I have these forms that create a post with all the information submitted. The Unique Value option was working fine when the form was only a submission and not creating posts. However, now that the forms have the Action to create posts, the unique value is not preventing duplicate post creation. Is there a way around this situation? Thanks in advance for any advice.
2 Answers
Victor Font answered 4 weeks ago
Formidable doesn't create duplicate posts if things are setup correctly. Formidable stores the post_id in the wp_frm_items table as part of the entry's header. That post_id is locked to that entry unless you decouple it with code. The unique value option has nothing to do with WordPress posts either. Setting a field to unique ensures that the field has a unique value across all of the form's entries. If you have 10,000 entries, that field will have 10,000 unique values. It has nothing to do with posts.
Pablo Tires answered 4 weeks ago
Hi Victor, thanks a lot for the prompt reply. I understand what you are saying, however for some reason on my form, when I set the action to create a post the Unique Value condition stops disabling the duplicate entry. As a result of this the, second post does have a different title and slug (It adds a -2 at the end) but the entry in the form is getting duplicate. Please refer to the snapshot attached to this comment. Thanks for taking the time to review this reply :)
Attachments
Victor Font replied 4 weeks ago

Adding -2 at the end makes it a unique value. I'm not following what you're doing or what screen you shared. That looks like a list of form entries, not WordPress posts.

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