Configure routing based on CPT/ACF

I have a real estate site with communities, agents, and listings (separate CPTs). The contact form on each listing currently goes to one person, but I’d like to configure routing to go to an agent based on the community the listing belongs to.

How can this be done?

With the help of someone in the Facebook group, the solution is to use a merge tag to output the custom field
e.g., {custom_field:my_field_name}

Then use “configure routing” to send to Agent X based on that result.

Problem is, in my case, it outputs the ID instead of the post title. Any idea how to get the post title instead of the ID?

Hi Jodzeee. Is there a reason you cannot use the ID in your routing rules, instead of the post title? If there is, then there may be a way around this, but it would not use the custom field merge tag, but this filter instead:

Let us know if you cannot use the post ID. Thank you.

Nah, I can use the ID, but it got me wondering how to do it - like if it wasn’t a hidden field and I actually wanted to show the title. I’ll just us the ID and call it a day :slight_smile: Thanks for your help!

Thanks @jodzeee. If the information you need is in the custom fields in the post meta, you can get it out with the {custom_field} merge tag. If you have a reference to the information you need (like the ID in this case) then you will need to use the gform_field_value filter to take that reference from the custom field, then look up the information you need (post title) and populate the field. It’s not quite as easy as the {custom_field} merge tag.

If you need anything else, please let us know.