Skip Navigation

[Resolved] Using function with conditional

This support ticket is created 2 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 5.05 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Bob 2 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2375517

Bob

I'm trying to check if a parent record has a value in a specific field.

I've tried using ( ( $(member-email).item(@member-item.parent) eq '' ) ) and ( empty( $(member-email).item(@member-item.parent)) )

with no luck.

I've read about using a function to return the field length but all the example I've found refer to the older versions e.g.
[wpv-conditional if="( '[fieldlength field='wpcf-author-name']' gt '1' )"]
YES
[/wpv-conditional]

how can I use this with the latest version? I've tried what makes sense to me syntactically with the advanced conditional editor but can't fathom ot.

Cheers in advance.

#2376181

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests and the following formats for the conditional statements worked inside the advanced editor of the "Conditional" block:

1. 'Not empty' check for the field "product-single-line-field" from the parent post in the relationship 'product-location':


NOT ( empty( '[wpv-post-field name=wpcf-product-single-line-field item=@product-location.parent]') ) 

2. Empty check for the field "product-single-line-field" from the parent post in the relationship 'product-location':


( empty( '[wpv-post-field name=wpcf-product-single-line-field item=@product-location.parent]') )

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2376489

Bob

My issue is resolved now. Thank you!
What you've said works and I think I can take that forward to what I need.
Great support as always.