• Resolved shagdirty

    (@shagdirty)


    Hi. How can I edit an existing form submission programmatically without tying into hooks? (so just running some php in a template file basically) Need to update a field with a link to a pdf. I have the submission ID (sub_id) and field id (which I assume is the number within the ‘name’ attr of the field) but it’s not working.

    I’ve tried just using this in a template file but it’s not working so I’m missing something. Perhaps that has to be tied into a hook (which probably wouldn’t work for me) or I need to instantiate (if that’s the correct term) a global nf variable?

    Ninja_Forms()->sub( 1338 )->update_field( 105, 'HOWDY!!!' );

    Thoughts?

Viewing 1 replies (of 1 total)
  • Thread Starter shagdirty

    (@shagdirty)

    Just remembered that submissions are a custom post type so used:

    update_post_meta( 1338, '_field_105', 'HELLO META!' );

    and that works great. I’d still like to know how to do it via API fanciness though. Perhaps creating a field and adding the data vs updating an existing field would be nice.

Viewing 1 replies (of 1 total)

The topic ‘Editing Existing Form Submission Programmatically’ is closed to new replies.