Add Key to JObject Conditionally

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

@benjamin.9052,

Have you tried this way using if condition?

' Assuming you have a JObject `jsonObj` and a variable `value1`
If value1 IsNot Nothing Then
    jsonObj("newKey") = value1
End If

I am unable to incorporate this syntax as i do not have a specified json object name

JObject.FromObject( New With {
	Key .transactionID=Nothing,
        Key .Emails = New With {
        If(Not String.IsNullorEmpty(variable)
		{  // add Key to the Jobject
		}
Key .cc2=in_Config("CC2_value").ToString,
Key .bcc1=in_Config("BBC1_value").ToString,
}
}