Creating form entry with embedded form

By: Leo Walker | Asked: 04/02/2025
ForumsCategory: Code HelpCreating form entry with embedded form
Leo Walker asked 3 weeks ago

Has anyone had success creating a form entry programmatically for a form that contains an embedded form? I think I understand all the relationships - the field value on the master form is the entry id for the subform; the entry on the embedded form must show the main form entry id in the parent entry id. But I can’t get the linkage to work.

i ve tried creating the embedded form entry first, putting its id in the master entry meta, then updating the parent field in the embedded entry once the master is created.  I’ve tried creating the master first, then the embedded entry and updating the master meta field with correct entry id. And other permutations. None seem to work.

im open to ideas. Thanks.

1 Answers
Victor Font Staff answered 2 weeks ago

You’re thinking about the linkage incorrectly. Entry ids for parent and child forms are different. Child forms are processed first by Formidable. Repeater fields are a good example of an embedded form. All linking connections are handled internally by Formidable. Without actually seeing your site, it sounds like you’re over engineering the design. 

Leo Walker replied 2 weeks ago

Thanks, Victor. Yes, I know the id’s are different. The meta field for the embedded for in the parent entry will contain the entry id of the embedded form’s entry. And the parent item id element in the embedded form entry will contain the parent form entry id. Two different numbers. I thought that getting those right would be enough to connect them, but it isn’t.

I’ll give it a think to see if there’s a simpler way. Basic issue - someone completes the wrong form. I want to transfer the data to the correct form. (Yes, try to prevent it via UI /flow, but it still happens. ) Both forms have the same embedded form to capture the contact info. So I’m trying to point the contact info to the entry on the new form. But delaying the old entry also deletes the embedded form entry. So I have to clone that entry first then try to connect it with the new entry on the correct form. Both entries and all their meta appear correct, but Formidible doesn’t recognize the connection. I’ll keep working on it.

Thanks for making time to reply.

Victor Font Staff replied 2 weeks ago

With all the entries you're trying to connect and store to recreate what Formidable already does, the story is very confusing. Perhaps it would help to watch the video on my site about Formidable's metadata schema and how it stores data. It may clarify a few things for you. The video's on the home page https://formidable-masterminds.com/

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