Conditional relations text only

By: Rytis Karalius | Asked: 09/29/2022
ForumsCategory: How-toConditional relations text only
Rytis Karalius asked 2 years ago
Hi everyone, i have a form field that picks language of the current website, and based on that language i need to send a certain text to the custom created woocommerce product Excerpt, when the form is submitted. It would be simple as a stone, if i could use IF, however it's not working of course if([236]==en)[240]elseif([236]==lt)[241] What would be the approach to do it as simple as possible?
1 Answers
Bobby Clapp answered 2 years ago

If I read what you are trying to do right, you'll need this:

[if 236 equals="en"] [240] [else] [241] [/if 236] or maybe:

[if 236 equals="en"] [240] [/if 236] [if 236 equals="lt"] [241] [/if 236]

Rytis Karalius replied 2 years ago

Yeah, the problem is that in the form fields IF function with text (en)(lt) doesn't work, it has to be integers. And i somehow need to make IF [text], then [text], ifelse [text] then [text]. That's what formidable support also confirmed.

That's why i'm asking here. Maybe somebody knows some workaround for this?

Bobby Clapp replied 2 years ago

I'm pretty sure I've used it with strings in the way that I provided. The formidable example even shows it that way.

https://formidableforms.com/knowledgebase/conditionals/#kb-else

Rytis Karalius replied 2 years ago

<p>Thank you for example i will try that, however on the same page it is stated " These can be used in a View, email notification, confirmation message, or redirect URL. Conditionals can not be used as default values in fields or in field calculations." And i need them specifically as a field value :)</p><p>EDIT: doesn't work, tried it both ways.</p>

Bobby Clapp replied 2 years ago

Ah. My mistake. I didn't realize that would be in a form field (even though you indicated that). Let me look around and offer another suggestion.

Rytis Karalius replied 2 years ago

Thank you once again. Maybe i'll explain why i need this, and we could find another way to achieve this.

After form is completed, there is a woocommerce product created. Due to form being multilanguage, i need two languages for excerpt as well. I've tried using regular field translations, but when fields are transfered to woocommerce, only main language is passed (not translations), which is weird. That's why i have to make two hidden fields for excerpts and choose one of these with language identification field. I can't think of a different approach.

Formidable has a text field for product description for example, so it lets you enter any IFs if you want, however excerpt only lets you select a specific field from a form (with a drop down), which is stupid in my opinion, since excerpts usually have more than one sentence, etc. I've already registered this problem, but i'm sure it will take decades to implement.

Bobby Clapp replied 2 years ago

Have you read through this page: https://formidableforms.com/knowledgebase/formidable-multi-language/

It might give you some ideas.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right