Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionals doesn't work as expected. #19153

Closed
zozito opened this issue Jul 13, 2023 · 4 comments
Closed

Conditionals doesn't work as expected. #19153

zozito opened this issue Jul 13, 2023 · 4 comments
Assignees

Comments

@zozito
Copy link

zozito commented Jul 13, 2023

Describe the Bug

I have a field with a conditional raw value.

{
	"_and": [
		{
			"equipamento": {
				"fabricante": {
					"nome": {
						"_eq": "DELL"
					}
				}
			}
		}
	]
}

This will show one hide field when it is true
image

But, when I select the "fabricante" with the name "DELL" the hidden field doesn't appear as expected.

This only work if I create raw value with the "equipamento" ID, but that is not the conditional I want.

To Reproduce

Use conditional with one2many field to show/hide other fields

image

image

image

Let me know if you need something else.

Thank you

Directus Version

v10.4.3

Hosting Strategy

Self-Hosted (Docker Image)

@rijkvanzanten
Copy link
Member

Could you share a database dump with a minimal reproduction of this issue?

@zozito
Copy link
Author

zozito commented Jul 17, 2023

Will try to explain the best I can.

Create 3 tables, one called "Equipment" with the fields, ID, name, family (related One2Many with family), incidents (related One2Many with incidents), and description.

Another table with the name "Family" with the fields, ID, name, equipment (Many2One), and description.

Create the last table "Incidents" ID, Name, Equipment (Many2One), workorder, and description.

The condition is created in the "incidents" table in the "workorder" field as follows:

If equipment.family.name = DELL, the "workorder" field appears to be filled in. If it is not valid, it remains hidden by default.

directus_dump.zip

@zozito
Copy link
Author

zozito commented Jul 22, 2023

Hello,

Do you have any updates on this?

I don't know if it's I'm doing something wrong or if is a Directus bug.

Thank you

@rijkvanzanten
Copy link
Member

Thanks for the dump! That really helped understanding what you were talking about.

Conditional fields don't currently support nested relational fields. There's an open issue here tracking that feature: #8228

@rijkvanzanten rijkvanzanten closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants