• Resolved websherpa

    (@websherpa)


    It would be especially helpful to me to be able to Save Multiple Excel Export URLs for one Form (i.e. with different fields chose) for different purposes.

    It would also be even more useful if you could add Any/All Conditional Logic Parameters (similar to the standard GF Exports) such that it will only export a subset of Entries that agree with the logic.

    Perhaps these things can be done with some additional code, but I haven’t been able to discern it yet.

    Thank you!

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi @websherpa

    I’ll get back to you on these issues. I just became a dad (for the second time) so I’m a bit preoccupied.

    Will let you know asap.

    Thread Starter websherpa

    (@websherpa)

    Congratulations! This is a feature we may be able to throw some programming money at for you to help with diapers. (My two are teens and one just leaving the nest. It’s quite the journey – that never ends. lol)

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @websherpa,

    Thanks. It’s been quite a ride getting here, but we’re enjoying it immensely.

    In between diapers and sleep I’ve been thinking about this issue. I don’t see this as a feature that would benefit the plugin as a whole, but I can see some people using it. Therefore I’m not keen on implementing it as a plugin feature, but I’d rather help you out by providing a piece of code that accomplishes the same.

    But before I go any further in my thought process, I’d like to ask if you could live with a more programmatical solution. I’m thinking you can keep using the same url, but by appending something like ?filterset=somethingA or ?filterset=somethingB the results will be according to the provided subsets. These will have to be set programmatically as an array. Something like:

    $sets['somethingA'] = [
        'field_1', '=', 'Some name',
        'field_3', 'contains', 'gmail.com',
    ];

    And then those filters would apply when using that filterset.

    Does that sound like something you can work with? The plugin has the necessary hooks to make this work.

    The filter GUI is something that I have on the roadmap, but I’m not sure about the implementation yet. I want it to work better that, or at least as good as, the GF one but when I’m duplicating that much code, I start to wonder if moving the plugin to the export section isn’t a better option. I’m not sure yet.

    Please let me know what you think about this.

    Thread Starter websherpa

    (@websherpa)

    Thank you, I almost missed this one!

    Any method of being able to filter the resulting Excel Export based on conditional logic would be absolutely fantastic, and I can work with any version and customizing a URL with parameters, so long as you provide me with a workable example. Although I do understand what you have above, I would need to know how (surrounding code) / where to encode the filter logic array.

    Thank you. Another box of expensive diapers would be on its way to you.

    Thread Starter websherpa

    (@websherpa)

    Good Morning Doeke,

    I just thought I’d check in on you with this one. I wasn’t certain (sicne I responded late), whether this was something on your short term or longer term radar. (And I appreciate knowing either way, just so I can determine another route if necessary as the Children’s Camp I would use it for to draw out weekly reports begins next week.)

    Many thanks as always!

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @websherpa,

    I already have some code ready. It works, but I’d like to clean it up some more. I’ll try to vet to it later today.

    Cheers.

    Thread Starter websherpa

    (@websherpa)

    That’s fantastic! Thank you for the very quick response, it is much appreciated.

    Plugin Author Doeke Norg

    (@doekenorg)

    @websherpa checkout https://gist.github.com/doekenorg/5755c563e54f02af7e31e90cfbfc2a14.
    Not my finest work, but it should do the job for now. I’ll revisit this in the future, and If I come up with something better, I’ll let you know.

    Thread Starter websherpa

    (@websherpa)

    I think that will work well. Just to clarify, the example works like this?

    https://www.somewhere.com?subset=groupA ?

    (Sorry, sometimes I need things in simple demonstrations to completely understand without experimentation since my PHP is so minimal.)

    Also, apart from having a routine to pass and then break apart an array (so that customized search parameters can be passed without programming them into the code), I am wondering how hard it might be to adapt the code to pass pre-defined parameters like this (even assuming only a single search operator and value):

    https://www.somewhere.com?GFE_formID=2&GFE_fieldId=4&GFE_searchOperator=contains&GFE_searchTerm=Onion

    Thank you once again … I am just testing it now.

    Thread Starter websherpa

    (@websherpa)

    Or more accurately: https://www.campwaterdown.com/gf-entries-in-excel/f2596fb9f998c78efc5eadb5527ffb4796f331e459c039f17e294205096random4?subset=groupA; ? Right?

    Plugin Author Doeke Norg

    (@doekenorg)

    Yes, without the trailing ;.

    In regards to your other question: this is on my short list, but I’d like an easier url structure, with all those operator options.

    Thread Starter websherpa

    (@websherpa)

    LOL, Works, but for others benefit, at first I missed that in the code you needed to load the filter with the Form ID.

    Can I assume that leaving out the Form ID on the add_filter would apply the routine to all gfexcel URLs….

    …. my thinking is that if I am adding URL parameters, I would do so to the Custom gfexcel URL related to the Form I want to filter anyway (so it could be assumed), and therefore it would be possible to apply the same filter group to multiple forms without having to code separate add_filter functions for each form individually??

    Plugin Author Doeke Norg

    (@doekenorg)

    The hook is used to change the search conditions for the querying of the entries. This is what GF uses internally, I just added a hook to make sure people could change some fields, and this hook is used for the date range.

    At the moment this hook doesn’t include the from itself as a parameter; that would be a good addition. I’ll put it on the list. However, the form_id IS (as you mentioned) part of the filter.

    When you omit the form_id, the code indeed applies to all forms, however; the forms all have their own fields, with different ID’s. These ID’s are only unique to the form. That’s why I’ve included that ID.

    More forms is exactly the reason I don’t like this code, and want to revisit it in the future ??

    So yes, you can omit the the form_id, and add multiple subsets, but make sure you use that subset only for the correct form ??

    Thread Starter websherpa

    (@websherpa)

    I think I understand, obviously you wouldn’t want the filter to run on all forms, but I was assuming that the Custom GF Excel Entries URLs runs its own code ONLY for the addressed Form (and so was hoping the routine and search parameters might only be applied by default there (since the result generated is only the one same form).

    However I don’t have trouble using it with the Form ID hook, I was just thinking there might be a built-in efficiency, by default.

    Thread Starter websherpa

    (@websherpa)

    Actually, what I didn’t make obvious in regard to not making the filtering Form ID Hook specific was that we clone a lot of our forms and so the Field ID for certain fields that are used over and over are the same.

    Plus $filter subsets can be form specific and so the routine will fire, but if there is no subset attached to the URL, then it simply returns the original search anyway.

    I’ve tested and there’s no significant lag by leaving off the Form ID hook.

    So the efficiency I was referring to IS already there in the code. In my case it would likely not be necessary to have separate add_filer Form Specific hooks, just multiple subsets to be used with specific forms. (If that makes sense.)

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Multiple Saved Excel Exports and with Conditional Logic (Feature Request)’ is closed to new replies.