Hi I am trying to add a Key to the Jobject based on a condition. I am not able to find the syntax . Can someone Help me with the Syntax to use If condition inside the JObject.
for eg :
If value1 is not Null ( add Key to the Json Object)
Else ( Do not add the Key to the Json Object)
Key .Emails = New With {
If(Other_Partner_email.Contains("NA"))
{ // Do not add the Key
}
Else
{ // add Key to the Jobject
},
Key .cc2=in_Config("CC2_value").ToString,
Key .bcc1=in_Config("BBC1_value").ToString,
Key .bcc2 = in_Config("BBC2_value").ToString
}
Expected output :
"Emails": { "cc1": "testcc1@gmail.com", "cc2" : "testcc2@gmail.com", "bcc1": "testbcc1@gmail.com", "bcc2": "testbcc2@gmail.com" },
OR
"Emails": { "cc2" : "testcc2@gmail.com", "bcc1": "testbcc1@gmail.com", "bcc2": "testbcc2@gmail.com" },
Please do let me know i f you need more details