You are here:
InsCensusService:updateMembersWithPlans
Use this service to populate a census with primary members, their dependents, and their pre-enrolled plan.
Method: updateMembersWithPlans
How It Works
-
The service calls
updateMembersto save data about the members, parsing through the members in the JSON object and adding an Id andisNewMemberfor each one. -
The service then calls
addPlanSelectionsto save members' pre-enrolled plans. -
If
isNewMemberis set to true,addPlanSelectionsdeletes any newly created members that do not have entries inGroupCensusMemberPlan__cand ifonlySaveMembersWithValidProductsparameter is set to true.
Remote Options
Option |
Description |
|---|---|
|
Required Id of census where members to be uploaded belong or will belong. Used to validate that the contractId belongs to the account/census. |
|
Required Id of Account's current contract. Used to validate that the plans of each member is part of the contract. |
|
Boolean if true, new members without entries
in |
|
Stringified list List of fieldAPI names of
Used to determine which members already exist in the table, in which case an update is executed instead of an insert. |
Input JSON
Here's what the format looks like for the input JSON:
{
"censusId":"a4D4P000000hbjSUAQ",
"contractId":"a4D4P000000yujQER",
"onlySaveMembersWithValidProducts":true,
"census":{
"headers":[
{
"name":"vlocity_ins__FirstName__c"
},
{
"name":"vlocity_ins__LastName__c"
},
{
"name":"vlocity_ins__IsPrimaryMember__c"
},
{
"name":"vlocity_ins__IsSpouse__c"
},
{
"name":"vlocity_ins__MemberIdentifier__c"
},
{
"name":"vlocity_ins__PrimaryMemberIdentifier__c"
},
{
"name":"Id"
},
{
"name":"vlocity_ins__ContractLineId__c"
},
{
"name":"vlocity_ins__IsOptOut__c"
},
{
"name":"vlocity_ins__OptOutTypes__c"
}
],
"members":[
{
"vlocity_ins__FirstName__c":"Maurice",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":true,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Maurice",
"vlocity_ins__PrimaryMemberIdentifier__c":null,
"vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ;a4D4P000000hbjSUAQ",
"vlocity_ins__IsOptOut__c" : false,
"vlocity_ins__OptOutTypes__c" :null
},
{
"vlocity_ins__FirstName__c":"Lizzy",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":false,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Lizzy",
"vlocity_ins__PrimaryMemberIdentifier__c":"Maurice",
"vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ",
"vlocity_ins__IsOptOut__c" :true,
"vlocity_ins__OptOutTypes__c" :null
},
{
"vlocity_ins__FirstName__c":"Jamie",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":false,
"vlocity_ins__IsSpouse__c":true,
"vlocity_ins__MemberIdentifier__c":"Jamie",
"vlocity_ins__PrimaryMemberIdentifier__c":"Maurice",
"vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ",
"vlocity_ins__IsOptOut__c" : false,
"vlocity_ins__OptOutTypes__c" :"Medical"
},
{
"vlocity_ins__FirstName__c":"Bella",
"vlocity_ins__LastName__c":"James",
"vlocity_ins__IsPrimaryMember__c":true,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Bella",
"vlocity_ins__PrimaryMemberIdentifier__c":null,
"vlocity_ins__ContractLineId__c":null,
"vlocity_ins__IsOptOut__c" :true,
"vlocity_ins__OptOutTypes__c" :null
}
]
},
"duplicateKeys" : [
"vlocity_ins__FirstName__c",
"vlocity_ins__LastName__c"
]
}Output JSON
Here is a sample output JSON:
{
"errors":[
{
"error":"ContractLineItem__c value is not valid:8004P000000zJKjQAM; Medical",
"vlocity_ins__FirstName__c":"Maurice",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":true,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Maurice",
"vlocity_ins__PrimaryMemberIdentifier__c":null
}
],
"censusMemberIds":[
"a4C4P000000ed6dUAA",
"a4C4P000000ed6eUAA",
"a4C4P000000ed6fUAA"
],
"memberPlanIds":[
"a4B4P000006jKsMUAU",
"a4B4P000006jKsNUAU",
"a4B4P000006jKsOUAU",
"a4B4P000006jKsPUAU"
]
}
