Solved

How to link two look ups?

  • 2 March 2024
  • 4 replies
  • 57 views

Badge +1

How do I create two lookups and link them together so that a particular element in one of the lookups is mapped to a element in another lookup in web app .

icon

Best answer by rafeeq.durowoju 6 March 2024, 15:40

View original

4 replies

Badge +1

Hey Yasharth, 

Within the web application, there currently isn’t the ability to create lookups with relation to each other. Furthermore the lookups generated in the Web application are single column lookups used to validate the presence of a value within a specific field.

May I ask what your use case is here? Perhaps there might be another way to achieve your desired use case.

 

Regards, 

Rafeeq

Badge +1

Hey @rafeeq.durowoju thank you so much for answering. So my use case was that I had a lookup created for city and states each so when I select a city it should be from the same state if otherwise it should flag an error.

for eg-in the city section if I select Boston and in the state section if I select Massachusetts then it should be right

but if for Boston if I select Ohio it should flag an error.

Badge +1

Hey @Yasharth Misra, for this use case you probably need a multi-column lookup within a component rule. You can build the lookup in ONE desktop where they lookup key is the city name, and the second column is the state. Within the component rule you can can set up a temporary column, which will be assigned the lookup value, then you can check that the lookup value matches the input value. If so its valid, if not, invalid. 

Lookup Builder
Example of Component Rule structure
Example of lookup Result

In this set up, you would have a validity check the lkp_state matches the input state to be valid. The first record would be invalid, the second record valid.

One thing to consider here are States that share City names might be an issue, either one City name only maps to one State, or if the lookup is allowed duplicate keys, a City name might return multiple records, you need to ensure the component rule preserves the record count and order of the CI that it is ran against. 

 

Hope this makes sense and helps you decide which route you want to take. 

Regards, 

Rafeeq 

Badge +1

Thank you so much @rafeeq.durowoju that was really helpful.

Reply