Conditional Logic in Feeds

I’m working on building a feed addon for ReferralMD and I’m wondering… Does the Conditional Logic Object extend to the feed_settings_fields() for the addon API? I get a string validation error when I try to use it, so I’m assuming it doesn’t. I just need a simple if.field->name.is:value(show/hide.field->name) type of function similar to: https://docs.gravityforms.com/conditional-logic/

I was looking through the Mailchimp code because I remembered it had a sort of logic based on the list that was selected, but those fields are being dynamically generated on the fly based on Mailchimp’s active settings. This is a bit overkill for my needs.

I’m willing to program it, but I was hoping to just use functionality that already exists in GF.

It sounds like you want to show/hide a setting on a feed if a condition is met? If so, you’ll want to use the “dependency” property on your conditional setting:

'dependency' => array( 'field' => 'myfield', 'values' => 'myvalue' ),

The dependency is only evaluated on render so you’ll have to trigger a refresh by submitting the form:

'onchange' => 'jQuery( this ).parents( "form" ).submit();'

I know… it’s a clunky. New version of the settings API is in progress and will be tasty, tasty!

2 Likes

Ahhh… yeah I saw “dependency” when I was perusing the Mailchimp addon. That should have tipped me off.

Any idea on this new tasty API timeline?

1 Like

Alas, I can’t disclose such delicious information but I can say that it is in active development. :smile:

2 Likes
© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.