<?php
add_filter( 'ninja_forms_render_default_value', 'my_change_nf_default_value', 10, 3 );
function my_change_nf_default_value( $default_value, $field_type, $settings ) {	
	if( $settings['key'] == 'hidden_logged_in' && is_user_logged_in() ) {
		$default_value = '1';
	}
	else if( $settings['key'] == 'hidden_logged_in' && !is_user_logged_in() ) {
		$default_value = -1;
	}	
	
	if( is_user_logged_in() && $settings['key'] == 'hidden_id' ) {
		$default_value = get_current_user_id();
	}
	else if ( !is_user_logged_in() && $settings['key'] == 'hidden_id' ) {
		$default_value = -1;
	}
	
	return $default_value;
}