Skip to Content Skip to Menu

Conditional - multiple fields

  • cpaschen
  • cpaschen
  • OFFLINE
  • Posts: 327
  • Thanks: 42
  • Karma: 9
7 years 5 months ago #289081 by cpaschen
Conditional - multiple fields was created by cpaschen
We have several fields that are 'strung together' with conditionals:

Field 1 - Country (Query Drop Down, single select, onto table listing countries) - no conditions

Field 2 - State / Province (Query, single select, onto table listing states by country; update on Field 1) - condition self / Field 1 / empty / hide
with a manually added value of 99999 with a label "My State is not listed"

Field 3 - New State (Text Field) - condition self / Field 2 / Equal to / 99999 / Show / Translate=YES (this appears when user selects 'state not available' in Field 2; otherwise hidden)

Field 4 - Regional Organization (Query Drop Down, single select, onto table listing organizations, filtered by country/state provided from previous fields) - condition self / Field 2 / Empty / Hide (hide until user selects an entry for Field 2)
with a manually added value of 21212121 with a label "My org is not listed"

Field 5 - New Regional Organization (Text field) - condition self / Field 4 / Equal to 21212121 / Show / Translate = YES (this should only show when the user selects "My org is not listed", but it is always showing at this point.

Field 6 - Individual Organization (Query Drop Down, single select, onto table listing organizations, filtered by Field 4 selection) - condition self / Field 4 / Empty / Hide (only show if something is selected in Field 4 (this works fine)
with a manually added value of 9999 with a lable "My Organization is not listed"

Field 7 - New Indivdiual Organization (Text field) - condition self / Field 6 / Equal to 9999 / Show / Translate = YES (only show when "My organization is not listed" is selected in Field 6) (This works fine)


We are using:
Joomla: 3.6.5
CB: 2.1.0
CB Conditional: 4.0.7+build.2016.12.19.16.43....

I have the CB Conditional parameters set to Backend:enable; Reset: enable;

All the conditions appear to be working except th one for Field 5. The configuration is set the same as for field 3 and field 7 which are working properly, but that one is not.

With debug enabled on the cb conditional plugin I get:

string(120) "{"location":"edit","input":"","operator":6,"value":null,"condition":{"match":true,"show":[],"hide":[94],"static":false}}" string(124) "{"location":"edit","input":"","operator":0,"value":"99999","condition":{"match":false,"show":[78],"hide":[],"static":false}}" string(120) "{"location":"edit","input":"","operator":6,"value":null,"condition":{"match":true,"show":[],"hide":[99],"static":false}}" string(128) "{"location":"edit","input":"","operator":0,"value":"21212121","condition":{"match":false,"show":[100],"hide":[],"static":false}}" string(120) "{"location":"edit","input":"","operator":6,"value":null,"condition":{"match":true,"show":[],"hide":[61],"static":false}}" string(127) "{"location":"edit","input":"4764","operator":0,"value":"9999","condition":{"match":false,"show":[62],"hide":[],"static":false}}" string(127) "{"location":"edit","input":"4764","operator":0,"value":"9999","condition":{"match":false,"show":[77],"hide":[],"static":false}}"

But I have no idea how to decipher that debug data.

Any ideas what the problem is? Or where to start digging?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 68605
  • Thanks: 9108
  • Karma: 1434
7 years 5 months ago - 7 years 5 months ago #289095 by krileon
Replied by krileon on topic Conditional - multiple fields
The condition you're having issues with is the following.

{"location":"edit","input":"","operator":0,"value":"21212121","condition":{"match":false,"show":[100],"hide":[],"static":false}}

The value following "input" is the value it's checking against. In this case it's seeing Field 4 is empty. It's then seeing that you've that value to condition "Equal To" (operator 0) the "value" of "21212121". This is of course false as "match" notes. This all looks correct and it should reverse "show" to "hide" since "match" is false. Is there any other condition being applied or CB Privacy, etc.. being applied to that field?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 7 years 5 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • cpaschen
  • cpaschen
  • OFFLINE
  • Posts: 327
  • Thanks: 42
  • Karma: 9
7 years 5 months ago #289116 by cpaschen
Replied by cpaschen on topic Conditional - multiple fields
THANKS for explaining the debug results - that is VERY Helpful.

No other conditions applied (either as 'self' or from other fields). And we don't even have the CB privacy plugin installed.
The only thing (other than a plain text element) is that there is a validation of min. 2 chars imposed.

Any other ideas?

Should I just delete the field and re-create it to see if that resolves it? (We're still in dev mode so no data to loose).

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 68605
  • Thanks: 9108
  • Karma: 1434
7 years 5 months ago #289120 by krileon
Replied by krileon on topic Conditional - multiple fields
It's really strange since field 4, 5 and 7 are basically the exact same condition usages yet 4 fails. Try creating a new field with that same condition and see if it works. Was field 4 a different fieldtype at any point? There's been some reports that changing fieldtype can cause some wonky behavior sometimes.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • cpaschen
  • cpaschen
  • OFFLINE
  • Posts: 327
  • Thanks: 42
  • Karma: 9
7 years 5 months ago #289136 by cpaschen
Replied by cpaschen on topic Conditional - multiple fields
OK ... I've tried several different things, including a completely new text field and it's doing the exact same as the previous one (the one not working).

However, I have found either the cause or a work-around.

Field 4 Query has TWO entries in the "Update On" field of the Parameters | Query. The other queries only have one 'Update On' entry (they don't need both)

So ...

Field 1 - Country
NO Update On

Field 2 - State
1 Update On (on Field 1 - the Country field)

Field 4 - Regional Org
2 Update on ( Field 1/ Country and Field 2 State)

Field 6 - Individ Org
1 Update on (Field 4 - Regional Org)


The 2 'update on' entries were due to the fact that the query was using both FIELD 1- COUNTRY AND Field 2 - STATE in the WHERE clause (JUST in case there was two "Minnesota"s in the world ).

When I have just one Update On (but keep both fields in the were clause) the field initially shows the entry that was manually added the 9999 or 212121 entry and then displays the last one from the query in the list. But it appears that it actually 'selects' that initial entry - which happens to be the one we are comparing against (at least that's the best I can figure what is happening)

When I have just one Update On and remove the Country in the WHERE clause, the selector works as it should.

This should work OK in this instance (the two-field WHERE clause was to address an issue that we no longer have in the data tables); however, I think it points to potentially some problem in the way the Update is effecting the results (or conditions) when it comes to query fields.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 68605
  • Thanks: 9108
  • Karma: 1434
7 years 4 months ago - 7 years 4 months ago #289154 by krileon
Replied by krileon on topic Conditional - multiple fields
Ok, so to understand correctly when the update on is triggered and the value you're conditioning against is removed it messes up or it's doing this when the value you're conditioning is added? If it's being added and it's the first value it's then auto selecting and you'd expect the condition to trigger at that point, but what happens if you select a different value then select the value you're conditioning against; does it work then? This is likely just a problem with update on not triggering the change event most likely and CB Conditional is never seeing that the field changed values.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 7 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn