Dropdown list dynamic options based on previous choice


I have list of Campaigns and they have list of Clients.

I want to build a dropdown for Clients for selected Campaign, but I have the results as a list, not as separate items:
Screenshot 2024-02-07 at 20.05.48

My search:
Screenshot 2024-02-07 at 20.05.57

Clients Object:
Screenshot 2024-02-07 at 20.23.15

What I’m doing wrong? What I should be reading about?

Option caption will be Current Option's Name if you want it to be Campaign. If you want to display the list of Clients though, you should change the Type of Choices to Client and Search For Campaigns' each item's PartnersId:unique maybe.

@hergin thank you for your reply. OK, I’ll change the Type to Client, you are right.

There are many Campaigns and Clients can be in many of them. So I’m not sure how I should use :unique

I’ve changed the type to Client as you suggested:
Screenshot 2024-02-07 at 20.43.24

My idea is to do a Search in Clients and check if the Client ID is in PartnersID list. But I get error
Evaluates to list of Clients but that’s what I want to do…

ClientId is probably just an ID (of text or number) but the custom state is a list of Clients. Probably, you want to do something else.

If the custom state index's campaign-edit's PartnersId already is a list of clients, why not set the choices source to that?

@hergin you are brilliant! It worked, simple and better then my ideas, thank you!

Screenshot 2024-02-07 at 20.52.36