Get data from post

Hi, i am new to GF and i would like to help (if possible).

I have a site with ads (car listing). I want to add a button on every single ad that will redirect the user to a specific page (elementor page) which will include the form I build with Gravity forms.

I want the form to get some data from the previous ad that the client was. Data like post title, tag {price} (custom field), etc.

How can make this work?
Thanks in advanced

You can use the custom_field merge tag as “default value” for any field in the form that is embedded in the post. Here is the documentation for that :clap:

Using your custom field price this would be the merge tag you use for default value for a field in the form:

{custom_field:price}

If you need anything else, please let us know.

Thanks for the reply.
I know this. The form is on a specific page. Not embed inside the post.

On the post I have a button “apply now” and this button redirects you to the page /contact . There is the form. I can edit the link to get the post id /contact/?post_id=4717 where 4717 is the post id where i came from.

So how i could get values from post 4717?

Thanks

If you can send the query string parameter post_id with the ID of the post, you can dynamically populate fields in the form with information from that post. You will need to use a WordPress function to get the post data.

Then, once you have the pieces of data you need from the post, you can populate fields in your form using the gform_field_value filter:

If you have any other questions, please let us know.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.