gravity-pdf icon indicating copy to clipboard operation
gravity-pdf copied to clipboard

Add Entry Meta as PDF Conditional Logic Options

Open jakejackson1 opened this issue 2 years ago • 7 comments

Description There are a number of missing conditional options missing from Gravity PDF's Conditional Logic feature that can be found on the Entry List search list. For example, we are unable to disable PDFs if the Payment Status isn't set to "Paid".

Expected behavior To be able to add conditional logic on this meta data.

Screenshots Screen Shot 2022-08-19 at 4 13 38 pm

jakejackson1 avatar Aug 19 '22 06:08 jakejackson1

Quick updates @jakejackson1. I tried to add some sample edit in our conditional logic : image

jestonihpi avatar Aug 26 '22 03:08 jestonihpi

This JS hook would be the ideal candidate: https://docs.gravityforms.com/gform_conditional_logic_fields/

After reviewing the entry options available, here's what we want to ideally support:

  • Entry ID: is isnot > <
  • Starred: is isnot, select choices: Yes:1 No:0
  • Payment Status: is isnot, select choices: standard list of GF payment status options
  • Payment Date / Entry Date: is < >, date picker
  • Payment Amount: is isnot < > contains starts_with, ends_with, text box
  • IP / Source URL: is isnot contains starts_with ends_with

jakejackson1 avatar Aug 26 '22 04:08 jakejackson1

Copy @jakejackson1, I was actually using that snippet for that sample. My initial idea is to parse some php code inside that js loop. I also checking out the actual entry search class hoping for some ideas among other places.

jestonihpi avatar Aug 26 '22 05:08 jestonihpi

@jestonihpi here's a leg up https://github.com/GravityPDF/gravity-pdf/pull/1405

I've opted to focus only on the payment status and payment amount values right now, as they are most important items for PDFs. I haven't verified Gravity Forms correctly takes the saved PDF conditional logic and pass/fails the entry based on the new settings. We may need to write additional code to ensure these checks are done correctly.

jakejackson1 avatar Aug 26 '22 05:08 jakejackson1

Copy @jakejackson1.

jestonihpi avatar Aug 26 '22 05:08 jestonihpi

Hi @jakejackson1 , I have tested this update on my end and one thing I have noticed that its not consistent in terms of saving the conditions ( sometimes it does,sometimes it just reverted back to Name with an empty value and default operator ). I am using GravityForm CLI to manipulate the meta values for this tests.

jestonihpi avatar Sep 05 '22 07:09 jestonihpi

@jestonihpi I might need to do a screen sharing session with you to see exactly how to replicate this.

jakejackson1 avatar Sep 06 '22 00:09 jakejackson1