Seach results as pdf files


I would like to have a search field that gives a result (only one) from pdf-files that are downloaded to media library. Is it possible? I already tried it with WP Sunshine’s Search Field app, but I could not get it work…

To clarify:
A set of pdf’s are downloaded to media library and named in certain way (lot and ref-numbers). A person enters a specific search code (comes from pdf’s name) to search field and it gives just that one pdf as a result.

Hi Maarit. What is the reason for using Gravity Forms to create a search tool for your media library? I am curious about your requirements. Please share anything you think is relevant. Thank you.

I like the plugin and think it is so versatile that it could do anything :blush:
And I’d like to use gravity form’s conditional logic before showing certain pdf files.

Ystävällisin terveisin

  • Maarit Jokinen

Hi Maarit,

That’s an interesting concept. It has some similarities to this support question - although that was focused on getting data from another form, not another part of WordPress.
With a little bit of code using the gravityflowformconnector_update_field_values filter you should be able to get what you are after.

If the notes below aren’t enough to get you towards solution, drop Gravity Flow support a message and we’ll see how we can assist further to it.

  • Use the Form Connector Update Fields step type.
  • Select the same form and entry ID (self) options along with one field for the basis of an “irrelevant” lookup.
  • Use the gravityflowformconnector_update_field_values to do your “actual search” against the media library to find the right filename. Something along these lines perhaps? Ultimately you would store the path into a text or url field on the $new_entry which the filter returns.
  • Then you could use a merge tag for the field in the confirmation. Or perhaps 2 different confirmation based on if a match was found.

If you do not need to keep a record of the searches made, the Form Connector also has a delete an entry step type that you could use to delete daily/etc.


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