CRM Integration

Status
Not open for further replies.

Gabriel Pinheiro

Joined
Sep 20, 2018
Messages
17
Reaction score
0
Im trying to make a template using the CRM Integration Editor, and the return is a Json but one os the parameters is a list of contacts where I would need the first one. always.. to get the id so basically contacts[0].vid.
I tried to make this here but got no success. it is possible to do it?
 
In the XML template, the Rules Group lets you select a single record. Then you use Variables to get values from that record. If your server is returning more than 1 record, after all the processing, the 3CX CRM engine will get the first value returned that matches the phone number.
 
In the XML template, the Rules Group lets you select a single record. Then you use Variables to get values from that record. If your server is returning more than 1 record, after all the processing, the 3CX CRM engine will get the first value returned that matches the phone number.
So in order to explain better, the json is basically


{
"id": "8342"
"contacts": [
{email: something}, {email: something}
]
}
i need to get the first email variable

I would set
Rule Gorup path contacts equals 0?
 
The rule should be:
Code:
<Rules>
  <Rule Type="Any">contacts.email</Rule>
</Rules>

But that will return all the records. Then, the engine will only select the records having a phone number that matches the caller number. So, for each record you need to output a phone number, and the first record matching will be returned.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei