Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Create record filters to use with different relationships that point the same table (city address)

Certified Senior Developer

Hi there!

Say I have several record types that have a postal address. 

For each record type, I have to do an advanced search on the address related to the record type

I would like to use a rule to create the filter, and use the rule instead of repeating the code each time. But for this to work, it looks like I have to pass each field as a separate input to my rule.

  a!queryFilter(
    field: ri!inputFieldCountry,
    operator: "=",
    value: ri!searchCriteria.country,
  ),
  a!queryFilter(
    field: ri!inputFieldDistrict,
    operator: "in",
    value: ri!searchCriteria.district,
  ),
  [...]

Is it possible to only pass the *relationship* as input, and then say to Appian to look for the field within that relationship? I don't think it's possible, but sometimes I get surprised by some Appian magic.

Here is what I tried, to no avail yet.

  a!queryFilter(
    field: ri!relationshipToAddress[{recordfieldCountry}],
    operator: "=",
    value: ri!searchCriteria.country,
  ),
  a!queryFilter(
    field: ri!relationshipToAddress[{recordfieldDistrict}],
    operator: "in",
    value: ri!searchCriteria.district,
  ),
  [...]

  Discussion posts and replies are publicly visible