I am working on an expression rule. In that rule, I need to get rows with null values as output. I am providing some map inputs like {username: test, fname: test1, lname: test2, email: test@gmail.com, username: test, fname: test1, lname: test2, email: ""}. I want to get the output as: {username: test, fname: test1, lname: test2, email: ""}. I am getting only null.However, I am unable to get the exact output. Can anyone help me out?.Thanks for your help in adavnce
a!localVariables( local!users: a!forEach( items: ri!users, expression: a!map( username: fv!item.username, firstname: fv!item.firstname, lastname: fv!item.lastname, email: fv!item.email ) ), local!nullValueUsers: a!forEach( items: local!users, expression: if( or( isnull(fv!item.username), isnull(fv!item.firstname), isnull(fv!item.lastname), isnull(fv!item.email) ), fv!item, null ) ), local!nulldataValueUsers: reject(fn!isnull, local!nullValueUsers), local!nulldataValueUsers ) ###rule input datatype- Map
Discussion posts and replies are publicly visible
Is your 'local!users' assignment done by the time you are looping through for the local!nullValueUsers assignment? Does anything change if you were to use ri!users directly on line 12 instead of the local!users?