DataSubset & Rule Reference Question

Certified Senior Developer

Hi Team,

I had 2 simple questions which I wanted to post here. Please help me if anyone has the answers : 

Context :

You are given a list of CDT / Dictionary / Map with a few fields, eg : 

{ { key: 12, val: "ABC" }, { key: 20, val: "DEF" }, { key: 30, val: "GHI" } }

Problem statement :

Get those CDTs which have key bw 10 & 25 

My approaches :

I had 2 approaches, both of which I have a roadblock

  1. I convert this to list to a data subset using toDataSubset function and then filter on this
  2. I create a rule which takes this `key` as an RI and then returns true / false based on condition. I will use this rule in the filter function and use wherecontains to filter out which matches our condition

Questions : 

Now for the approach 1, I had a question : how do I filter this custom data subset ? because I only see queryEntity and queryRecord but nothing to query this custom dataset 

For approach 2 : is there a way we can eliminate the need of creating a different rule in the env and somehow use some function .. is it possible to create local functions in appian ? something like : 

a!localVariables(
  local!a:  (var){
    
  }
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Now for the approach 1, I had a question : how do I filter this custom data subset ? because I only see queryEntity and queryRecord but nothing to query this custom dataset 

    You cannot filter a custom DataSubset directly; queryEntity/queryRecord work only on database/record entities.

    For approach 2 : is there a way we can eliminate the need of creating a different rule in the env and somehow use some function .. is it possible to create local functions in appian ? something like : 

    Does not support local or anonymous functions; separate expression rules are required for reusable logic.


    Recommend, Use inline filter expressions with conditions or separate rules to filter lists efficiently.

Reply
  • 0
    Certified Lead Developer
    Now for the approach 1, I had a question : how do I filter this custom data subset ? because I only see queryEntity and queryRecord but nothing to query this custom dataset 

    You cannot filter a custom DataSubset directly; queryEntity/queryRecord work only on database/record entities.

    For approach 2 : is there a way we can eliminate the need of creating a different rule in the env and somehow use some function .. is it possible to create local functions in appian ? something like : 

    Does not support local or anonymous functions; separate expression rules are required for reusable logic.


    Recommend, Use inline filter expressions with conditions or separate rules to filter lists efficiently.

Children
No Data