The situation is :
A custom form for data entry in dataset exist with notably custom functions triggered when the event’s status is completed after validation. I would want to push a bunch of the Data Element collected through the API instead of the forms but still need to trigger those functions without having to go back to the Data Entry and visit all the forms.
Is there a way to trigger the validation + completeness of data entry custom forms that would make those functions runs through the API after the data elements import by any chance ?
Hey Yes, the custom functions are in the HTML code of the custom form and populate other DE from the data entry once validated. It is there for historic reasons and for the moment, I need both to coexist as the custom functions have not been implemented elsewhere yet (long story short) and I can’t populate those values form the API yet (or maybe at all).
AFAIK I understand your answer, when the data are sent via the API, it will still trigger the validation but probably not the custom functions in the HTML of the form?
The current workflow is:
Fill the form of some specific DE
Form is completed, custom functions in the HTML push other data values to a bunch of other DE
Not sure 2. is still the case going through the API.
Currently, the custom functions are not ported to the script of batch upload. Could be in the future but they require previous data from the DHIS2 and will introduce a lot of back an forth. On the how, it is just a CSV going through a Python script pushing data through the API DataValueSets.
If the functions are in the code of custom forms then there needs a way for the API to access these functions, but configuring that seems more complicated than moving/copying those functions to be used at the API level rather than custom form.
Unfortunately, there isn’t an out of box solution for this case at the moment. Maybe if you share more about the use case, we could get more insights from other community experts and software team.