title: Get post ID from selected dynamic field dropdown WPForms / Wordpress
body: <p>I have a post submission form using WPForms that allows my users to post articles via a form on my website.</p>
  <p>I have a custom post type also called 'channels'. the idea is that the user can select the channel from a dynamic field (this is a dropwdown that shows all custom posts <code>channels</code> where the author is the logged in user.</p>
  <p>When the user selects the channel they wish to 'post to' it populates an ACF custom field on the post being posted with the post title of the channel (not the post ID of the channel)</p>
  <p>I am trying to get WPforms to check the title, match it and get the right ID for that, then update the ACF field on submit.</p>
  <p>At the moment, nothing happens and the form fails to submit.</p>
  <p>Any one have any ideas on what i am doing wrong?</p>
  <pre><code>function wpf_save_update( $fields, $entry, $form_data, $entry_id ) {
  
  
      if ( absint( $form_data['id'] ) == 2480 ) {
  
  
      // Get the full entry object
      $entry = wpforms()-&gt;entry-&gt;get( $entry_id );
  
      // Fields are in JSON, so we decode to an array
      $entry_fields = json_decode( $entry-&gt;fields, true );
  
  
  // search database posts
  $post_name = $entry_fields[6]['value'];
  $author_id = get_current_user_id();
  
  $results = $wpdb-&gt;get_results( &quot;SELECT * FROM posts WHERE `post_title` = '$post_name' AND `post_author` = '$author_id' AND `post_type` = 'watch_channels' &quot;);
  
  
  foreach($results as $row){
  
  $entry_fields[6]['value'] = $row-&gt;ID;
  
  }
  
  
  
      // Convert back to json
      $entry_fields = json_encode( $entry_fields );
  
      // Save changes
      wpforms()-&gt;entry-&gt;update( $entry_id, array( 'fields' =&gt; $entry_fields ), '', '', array( 'cap' =&gt; false ) );
  
  
  
   }else{
   return;
  
   }
  }
  add_action( 'wpforms_process_complete', 'wpf_save_update', 10, 4 );
  </code></pre>