• Resolved kimhydrangea

    (@kimhydrangea)


    Hi There,
    Great plugin! Hey, we have about 100 forms. One of the fields on each form is a single line text field we labelled “Preferred Color”. However, each of our forms assigned a different Field ID to this.

    When I’m editing the php template that creates the PDF, if I put the merge tag {Preferred Color:81} it works fine but of course not with all forms, because not all forms have the ID of 81 for that field.

    If I place the merge tags like this – {Preferred Color:81}{Preferred Color:82}{Preferred Color:152}{Preferred Color:154}

    It works, unless there is a different field within the form with those ID numbers.

    Is there any way to use a Merge Tag without the Field ID? Or can I somehow manually set the ID for each so I can use one single merge tag with the PDF php file?

    I hope it makes sense what I’m asking. Thanks in advance.

    https://wordpress.org/plugins/gravity-forms-pdf-extended/

Viewing 1 replies (of 1 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi Kim,
    Thanks for your enquiry.
    As far as I know there is no way to use merge tags without the field ID, nor can you manually set the field ID as it’s locked to that particular field. You could, however, create a variable called $preferred_color and then use a switch statement to check which form is being used:

    switch ( $form_id ) {
    	case '1':
    		$preferred_color = {Preferred Color:81};
    	break;
    
    	case '2':
    		$preferred_color = {Preferred Color:82};
    	break;
    
    	case '3':
    		$preferred_color = {Preferred Color:152};
    	break;
    
    	case '4':
    		$preferred_color = {Preferred Color:154};
    	break;
    
    	...
    }
Viewing 1 replies (of 1 total)

The topic ‘Merge Tags without Field ID?’ is closed to new replies.