Hi @ejaganece
Thank you for response and I’m sorry for causing a bit of confusion.
The issue here is that the submission ID is not known until the submission is actually saved in DB and the post creation is slightly different – the post is created and the form submission is saved after that (so it could also include post data) which means that the “submission_id” is not yet substituted with actual number.
This requires a bit of additional custom code. I came up with this code and it should work just fine:
https://gist.github.com/adczk/f46b9545176bcb181830d8cc2329183c
To add it to the site:
– create an empty file with a .php extension (e.g. “forminator-submissionid-custom-field.php”)
– copy and paste code into it
– in this line set your form ID (should be the same number as in form’s shortcode)
$forms = array( 2297 ); // comma separated IDs of forms this should work with
– in this line set your “postdata” field id (if you only have one, most likely it doesn’t require change and is already correct)
$postdata_field = 'postdata-1'; // field ID of post data field
– and in this field replace MYCUSTOM with actual name of your custom field where you want submission ID to be stored
$customfield_id = 'MYCUSTOM'; // set the name of your custom field to be updated
– save the file
– upload it (via FTP or similar way) to the “/wp-content/mu-plugins” folder of your site’s WordPress installation.
It should then work out of the box.
Note: it does not require hidden field to be set at all on the form and it doesn’t require it to be mapped to custom field in form settings.
Best regards,
Adam