avniproject / integration-service

Service for integration Avni with other systems
GNU Affero General Public License v3.0
0 stars 2 forks source link

Set up Mapping config from Glific Output to Avni Subject Input #87

Closed himeshr closed 1 year ago

himeshr commented 1 year ago

Set up Mapping config from Glific Output to Avni Subject Input.

Tasks for mapping choosen fields of Student - from Glific flow_results to Avni Subject :

Query that has to be parameterized and used:

Later after Lahi team adds flag to indicate completion of flow, using the following Query:

select c.phone, fr.results, s.inserted_at
from `glific-lms-lahi.918956411022.contacts` c, UNNEST(c.fields) AS s
join `glific-lms-lahi.918956411022.flow_results` fr 
on fr.contact_phone = c.phone 
WHERE
(s.label, s.value) = ('avni_reg_complete', 'Yes')
AND
fr.name = 'Avni Students Registrations Flow'
AND 
s.inserted_at > DATETIME('2023-09-20T19:45:27')
order by s.inserted_at
limit 10
offset 0
vedfordev commented 1 year ago

Developer's Note:

Metadata Mapping Query: Link