Create Person in SF
Metadata
- Name: Create Person in SF
- Adaptor:
@openfn/language-salesforce
- Adaptor Version:
v1.3.2
- Created almost 6 years ago
- Updated almost 6 years ago
- Score: 0 (an indicator of how useful this job may be)
Key Functions
dataValue
, field
, fields
, humanProper
, relationship
, upsert
Expression
upsert("Patient__c", "CommCare_Case_ID__c", fields(
field('CommCare_Case_ID__c', dataValue("form.case.@case_id")),
relationship('Clinic__r', 'Location_ID__c', dataValue('form.case.create.owner_id')),
field('First_Name__c', humanProper(state.data.form.case.update.patient_first_name)),
field('Last_Name__c', humanProper(state.data.form.case.update.patient_last_name)),
field('Patient_ID__c', dataValue('form.case.update.patient_id')),
field('Age_Months_Started_Treatment__c', dataValue('form.case.update.age_months_start_treatment_rounded')),
field('Registration_Date__c', (state) => {
const validDate = state.data.form.case.update.registration_date
return ( validDate ? new Date(validDate).toISOString() : null )
})
))