Search code examples
2sxc

Is possible to have a field dependend on other field?


I have some dropdown list fields with countries, states, and cities but i need to have each one related to the other (dril Down) when you add a new item.

I need to have countries, when you select one country, i need another field be filtered with states, maybe somebody have an example form this

Thanks


Solution

  • So I don't have an example to show directly, but it can be done fairly easily AFAIK. Basically your first dropdown is on a field - let's call it CountryField (you shouldn't use the term field, but I'm using it here to ensure you understand the instruction).

    To filter the entities, you create a query with visual query to get only the ones matching the url parameter - use a ValueFilter or RelationshipFilter and check that it's equal to [QueryString:Country]. Add a test-value to your query (the test values are to the right) till you're sure it works.

    Then in the second dropdown you create an entity-query picker and specify that in the parameters it should use Country=[CountryField] (the thing from step 1).

    Basically now when the first dropdown changes, the second one should auto-re-request the data based on the first one.

    Good luck :)