Sim Greenbaum
09/08/2022, 1:45 PMlet phone =
options.shipphone.length <= 0
? fulfillmentRecord.setValue({
fieldId: "shipphone",
value: "<tel:845-357-3600|845-357-3600>",
})
: options.shipphone;
log.debug("phone", phone);CD
09/08/2022, 2:04 PMoptions.shipphone.length <= 0
is not how to test for nullSim Greenbaum
09/08/2022, 2:17 PMdbarnett
09/08/2022, 2:51 PM!options?.shipphone as first part of ternary expression
also Record.setValue returns the Record instance itself, so "phone" will be assigned to fulfillmentRecord in that case, not sure if that's desiredSim Greenbaum
09/08/2022, 2:52 PMdbarnett
09/08/2022, 3:02 PMSim Greenbaum
09/08/2022, 3:46 PMdbarnett
09/08/2022, 3:49 PM!'' === true -> true ?
or you can also call ?.trim() on it if you're meaning whitespace as blankShawn Talbert
09/08/2022, 9:51 PMfulfillmentRecord.shipphone = options.shipphoneSim Greenbaum
09/08/2022, 9:52 PMShawn Talbert
09/08/2022, 9:52 PMoptions.shipphone is undefined NFT automatically does nothingShawn Talbert
09/08/2022, 9:54 PMshipingaddressShawn Talbert
09/08/2022, 9:55 PMShawn Talbert
09/08/2022, 9:56 PMfufillment.shippingaddress.addrphone = options.shipphoneShawn Talbert
09/08/2022, 9:57 PM