Expression rule to compare two values

I want to write an expression rule to compare two values: 

first value is from rule input and second value from a db table field.If the values are same ,then another field(column) of my db table must be set to inactive or 0.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    FYI, you're able to edit your post if you want to change something, it's not really needed to post essentially the same thing again.

    For your question, you should be able to query from your database table (using a!queryEntity() or, preferably, referencing an existing expression rule you've already set up to handle queries to that table), and compare the result to the input value.  I'm not exactly clear what you mean when you say "another field of my table must be set to inactive", as an expression rule itself cannot change data in a DB table - what you describe will probably be most easily accomplished by using a process model which sets the desired value determined by some initial logic then writes that row back to your table.

  • Hi Mike

    Thanks for your response,by the line "another field of my table must be set to inactive",what I mean is I have a column name "is active" in my db Table. I also have columns "fieldid" and "formid" in my DB table.So what I exactly want to do is get rule inputs for formid and fieldid.If the rule input values of these 2 fields matches(same value) with the value i have in the db table for "fieldid" and "formid" column, then my "isactive" column must be set to 0 or disabled. 

Reply
  • Hi Mike

    Thanks for your response,by the line "another field of my table must be set to inactive",what I mean is I have a column name "is active" in my db Table. I also have columns "fieldid" and "formid" in my DB table.So what I exactly want to do is get rule inputs for formid and fieldid.If the rule input values of these 2 fields matches(same value) with the value i have in the db table for "fieldid" and "formid" column, then my "isactive" column must be set to 0 or disabled. 

Children