Skip to main content
March 2, 2023
Question

About Expression Rule Functions

  • March 2, 2023
  • 6 replies
  • 0 views

I have three CDTs that contain some fields with the same value.

I want to create an expression rule that matches them and extracts only the fields that don't overlap.

What function can I use to make it?

6 replies

abhayd3663
March 2, 2023

Use symmetricdifference() function.

a!localVariables(
  local!a: {1,2,3,4,5},
  local!b: {1,2,6,7,8},
  symmetricdifference(local!a,local!b)
)

O/P:

List of Number (Integer) - 6 items

    • 3(Number (Integer))
        • 4(Number (Integer))
            • 5(Number (Integer))
                • 6(Number (Integer))
                    • 7(Number (Integer))
                        • 8(Number (Integer))
                        March 2, 2023

                        Thank you for your reply.
                        However, because there are many fields in the CDT, it would be difficult to write an array.Is there any other way to achieve this without using an array?
                        For example, how to use the type! function to call the CDT and extract fields that are not duplicates.

                        March 2, 2023

                        you can use a!keys function to achieve your requirement. https://docs.appian.com/suite/help/22.4/fnc_informational_a_keys.html

                        1. First you need to get the CDT fileds form your CDT using keys function

                        2. Do a for each on your data and Index the  data using your keys 

                        3. Lastly compare the return data that you get form above step