a!localVariables( local!fabdetails2,local!result,local!samdata,local!samemails, local!reassigndetail: a!queryEntity( It can return 0 items or result like {{Email: "abc@gmail.com", accid: 10}, {Email: "xyz@gmail.com", accid: 8}, {Email: "shikhar.gupta@lamresearch.com",accid: 9}} This is List of Dictionary - 3 items ), local!fabdetails: a!forEach( items:local!reassigndetail, expression:rule!someexpressionrule(fv!item.accid) This expression rule returns data as {name:"Jenny",category:"HRA",Region:"USA"} so its in loop and it will return 3 records like List of Variant > List of Dictionary > Dictionary > List of Dictionary > Dictionary > List of Dictionary > Dictionary ), if(length(local!reassigndetail)<1, null, local!fabdetails2: a!forEach(a!flatten( local!fabdetails).name,fv!item), local!samemails: a!forEach(a!flatten( local!reassigndetail).Email,fv!item) , local!samdata : a!queryEntity( entity: cons!MPPCONSCDT_SAMAccountability, query: a!query( logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "email", operator: "in", value:local!samemails ), a!queryFilter( field: "name", operator: "in", value:local!fabdetails2 ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50 ) ), fetchTotalCount: false ).data, local!result: a!forEach( items:local!samdata, expression: cast(typeof('type!{urn:com:appian:types}MPPSAMAccoumtability'()),fv!item) ), local!result ) )
Its giving error with if else
help me to fix
a!localVariables( local!reassigndetail: a!queryEntity( It can return 0 items or result like {{Email: "abc@gmail.com", accid: 10}, {Email: "xyz@gmail.com", accid: 8}, {Email: "shikhar.gupta@lamresearch.com",accid: 9}} This is List of Dictionary - 3 items ), local!fabdetails: a!forEach( items:local!reassigndetail, expression:rule!someexpressionrule(fv!item.accid) This expression rule returns data as {name:"Jenny",category:"HRA",Region:"USA"} so its in loop and it will return 3 records like List of Variant > List of Dictionary > Dictionary > List of Dictionary > Dictionary > List of Dictionary > Dictionary ), local!fabdetails2: a!forEach(a!flatten( local!fabdetails).name,fv!item), local!samemails: a!forEach(a!flatten( local!reassigndetail).Email,fv!item) , local!samdata : a!queryEntity( entity: cons!MPPCONSCDT_SAMAccountability, query: a!query( logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "email", operator: "in", value:local!samemails ), a!queryFilter( field: "name", operator: "in", value:local!fabdetails2 ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50 ) ), fetchTotalCount: false ).data, local!result: a!forEach( items:local!samdata, expression: cast(typeof('type!{urn:com:appian:types}MPPSAMAccoumtability'()),fv!item) ), local!result )
If I remove if else, then it works fine if local!reassign fab have some data , if empty it gives error
Discussion posts and replies are publicly visible
If this is the exact code you're attempting to use, it looks like you have many lines of comments that aren't actually commented out (line 4, lines 17 - 25, etc)
I just gave idea what inside expression rules are returning,
Gotcha. I figured that might be the case but wasn't sure.
Can you expand on what specifically you're trying to do on lines 30 - 34? This doesn't look valid to me.