• Resolved hporter18

    (@hporter18)


    Hi,

    I am attempting to filter a wpdadiehard?form using query string parameters [[https://wywhockey.test/gamesheet/?scheduleID=24&visitorTeamID=24&homeTeamID=4]]. In my default where clause I have [[teamID =httpRequest[‘visitorTeamID’] and scheduleID = httpRequest[‘scheduleID’]]]

    I can get it to work using the wpdataaccess?form, but not the wpdadiehard?form. Is this because wpdadiehard?does not support using query strings as static filters in the default where clause? If this is not supported, what are my options?

    I do not think using wpda_search_column_paramName will work in this case because I have several forms on the same page and they need to use different parameters.

    Thanks,

    Harvey

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @hporter18,

    Thanks for the post.

    You can use direct filters on the shortcode itself.

    See here: wpdadiehard | WP Data Access

    Let us know if this works for you. ??

    Thread Starter hporter18

    (@hporter18)

    Hi Kim,

    It works if I hardcode the values, but not if I use the query string variables. What am I missing?

    This returns expected results: [wpdadiehard project_id=”34″ page_id=”39″ filter_field_name=”scheduleID,teamID” filter_field_value=”53,44″]

    This returns 0 results: [wpdadiehard project_id=”34″ page_id=”39″ filter_field_name=”scheduleID,teamID” filter_field_value=”$$scheduleID$$,$$teamID$$”]

    This is my URL:

    https://wywhockey.test/gamesheet/?scheduleID=53&visitorTeamID=44&homeTeamID=35

    This was the same result when I tried to use the default where clause.

    Thanks,

    Harvey

    Thread Starter hporter18

    (@hporter18)

    When I try this [wpdadiehard project_id=”34″ page_id=”39″ filter_field_name=”scheduleID, teamID” filter_field_value=”httpRequest[‘scheduleID’], httpRequest[‘teamID’] “]

    I get this error message, I’m assuming because of the extra square brackets:

     ERROR: Data Project page not found [need a valid project_id and page_id], httpRequest[‘teamID’] “]

    Thread Starter hporter18

    (@hporter18)

    Hi Kim,

    Can you give me an example of how to pass a query string parameter to a wpdadiehard? form?

    The wpda_search_column_paramName will not work in my case, neither will hard coding parameters.

    Here is my use case:

    • I am building a scoresheet page for a minor hockey league
    • as goals are scored i need to enter them in real time
    • my scoresheet has a wpdadiehard? form to enter/display goals for the home team
    • it has another wpdadiehard? form to enter/display goals for the visitor team
    • The Goals table has a teamID (ie no way to determine if it’s a home team or visitor team)
    • so when my page has url like below [[https://wywhockey.test/gamesheet/?scheduleID=24&visitorTeamID=24&homeTeamID=4]]., I want my Home Team wpdadiehard? form to use TeamID = **homeTeamID=4**
    • I want my Visitor Team wpdadiehard? form to use TeamID = **visitorTeamID=24**
    • The above works for datatables, but I need it to work for a data entry form

    Hope that makes sense

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @hporter18,

    It looks like it’s not currently possible to use URL parameters in the DEFAULT WHERE Clause for wpdadiehard shortcodes. ??

    I have forwarded this to Peter for clarification but it might take a while to receive a response as he’s currently working on personal matters at the moment.

    I’ll quickly send a follow-up once I receive feedback!

    We appreciate your undertanding. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wpdadiehard filtering with query string’ is closed to new replies.