JSON Complex Rule

I have no experience with JSON. I am trying to change the swap the variable inside a clause based on certain conditions. I cannot get this to work. Placeholder starts out empty. Based on conditions, I update placeholder with var 1 or 2.

if (AM_DRV_templateId == 'AM_APPEALS_PARTIAL_APPR_OR_DENIED_FULL' && (AM_DRV_levelOfAppeal[SYS_TableRow-1] == 'First and Final' || AM_DRV_levelOfAppeal[SYS_TableRow-1] == 'Second and Final'))
{
Appeals_Placeholder_Final_Adverse == Appeals_FinalLvlAppeal_Final_Adverse;
return true;}

else

if (AM_DRV_templateId == 'AM_APPEALS_PARTIAL_APPR_OR_DENIED_FULL' && (AM_DRV_levelOfAppeal[SYS_TableRow-1]== 'First of Two Mandatory' || AM_DRV_levelOfAppeal[SYS_TableRow-1] == 'Voluntary Internal' || AM_DRV_levelOfAppeal[SYS_TableRow-1] == 'External Review'))
{
Appeals_Placeholder_Final_Adverse == Appeals_Not_FinalLvlAppeal_Adverse';
return true;} else
return false;

thanks

Answers

  • Update:

    "level": "error", "line": 3, "char": 5, "code": "EX005178", "text": "Cannot assign value to variable \"Appeals_Placeholder_Final_Adverse\" defined outside of the rule" } ]}

    The VariableName is defined inside of Exstream or outside the rule. How do I fix this code?

    Updated code…

    if (AM_DRV_templateId == "AM_APPEALS_PARTIAL_APPR_OR_DENIED_FULL" && (AM_DRV_levelOfAppeal[SYS_TableRow-1] == "First and Final" || AM_DRV_levelOfAppeal[SYS_TableRow-1] == "Second and Final"))
    {
    Appeals_Placeholder_Final_Adverse = "a final adverse";
    } else {
    Appeals_Placeholder_Final_Adverse = "an adverse";
    }