• Resolved korgaltvde

    (@korgaltvde)


    Hello everybody,

    im using Forminator for making a Filled PDF File.

    I have a form and registered employees who can fill out this form. I use the Profile Builder plugin as a member plugin. I have a member field as a select that is selected for each user. I would now like that when someone fills out a form, this select value is automatically transferred. The field in Profile Builder is called market_name_1. Is there a way to have this field sent when the logged in person fills out a Forminator form?

    Thanks for your Help

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter korgaltvde

    (@korgaltvde)

    edit: it would be enough for me if the custom field is transferred to Forminator as a hidden value

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @korgaltvde

    I hope you are doing well today.

    I pinged our SLS Team to review your query. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @korgaltvde

    This snippet should help. In the hidden field you need to select “custom value” ” and then in value need to use??{profile_val}?macro.
    We areassuming the data is stored in user meta table so fetched it using?get_user_meta?

    add_filter( 'forminator_field_hidden_field_value', 'wpmudev_populate_hidden_field_date', 10, 4 );
    function wpmudev_populate_hidden_field_date( $value, $saved_value, $field, $hidden_field ) {
    	if ( ! is_user_logged_in() ) {
    		return $value;
    	}
    
    	if ( 'custom_value' == $saved_value && '{profile_val}' == $value ) {
    		$value = get_user_meta( get_current_user_id(), 'market_name_1', true );
    	}
    	
    	return $value;
    }

    He is a guide on how to install mu-plugin:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Kind Regards,
    Kris

    Thread Starter korgaltvde

    (@korgaltvde)

    It works, thank you ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Autofill from User Data’ is closed to new replies.