service_referral_notes concatenates three fields with a comma. Currently when these fields are not present in state we still add commas and send to Primero. service_referral_notes on this run is equal to ', , ' when it should be an empty string.
The specific request, in as few words as possible
Update job mapping to only add a comma only if the field is present.
Consider that only 1 (or 2) of the three fields might be defined... sometimes all three fields are not present in state.
Background, context, and business value
service_referral_notes
concatenates three fields with a comma. Currently when these fields are not present in state we still add commas and send to Primero.service_referral_notes
on this run is equal to ', , ' when it should be an empty string.The specific request, in as few words as possible
Update job mapping to only add a comma only if the field is present. Consider that only 1 (or 2) of the three fields might be defined... sometimes all three fields are not present in state.
state.json
See LP
Primero Gambella open_function
API userhttps://www.openfn.org/projects/p5am6e/messages/0615eae7-d5d3-7eb4-91bc-db715e10efa6
Expression
https://github.com/OpenFn/primero-progres/blob/master/jobs/1.upsertExtracts.js