CSV import Program indicators

Is there any possibility to import CSV file of Program indicators on DHIS2 Tracker, Which contains the list of program indicators created, i can clone the program indicators using DHIS2 Application, since i have to clone 541 program indicators which seems to be time consuming.

So i have created the list of indicators with code, lastUpdated, id, created, Name, shortName, aggregationType, displayInForm, aggregateExport,CategoryOptionCombo header but export/import apps using metadata import option doesn’t import,shows no response and no error, :frowning: can any one support in this case?

Hi Roshan, you can try the BIF app (available via the App Management app in DHIS2, or here: https://apps.dhis2.org/) which allows importing of metadata in a .csv file.
It has some helpful information as well to get you started e.g. the way to format the file to allow a proper import.

Edit: actually it doesn’t currently have the option for Program Indicators yet, is sort-of planned to come sometime according to the User Guide… sorry about that.

using the csv side of import/export has always been problematic for me. I’ve consistently resorted to having the details you are describing and subbing them in JSON snippets in Excel, and then copying/pasting into a text editor, and saving as a json file and importing. I know that sounds tedious…and it is…but once you do it a few times it feels like it opens a lot of doors. You can get the structure of the code by grabbing a sample ProgramIndicator in your server by /api/programIndicators and then if you take the first id that comes in and put /api/programIndicators/“id here”.json then you can copy this into excel, and remove all the pieces specific to the PI you have just taken.

What I’ll generally do is get my list of values, and then replace the value of the PI in the “Code” section with “BBB”. value of “LastUpdated” can be “CCC”, “id” “DDD”, “created” “EEE”, so on and so forth. Then i can do a nested substitute in excel, with =substitute(substitute(A2,“BBB”,b2),“CCC”,c2), where A2 is the original PI json snippet.

Anyway, if this feels like something you’d like to go down more, happy to talk more about it.

@Matthew_Boddie Actually if we could know that what is the query to insert programindicators in database, for PI, then we can create the sql query using some tool and generate the query finally firing sql on database…this sort of resolution, i am looking for…if any body can sort it out.

You could export the program indicators via the api using the query below, you can filter it by the program id if you are only want specific indicators:


Save the json output and using the Export/Import module, Import them to intended instance.

Thank you everyone for support, the concept is we need fire sql insert query in 2 relation namely programindicator and periodboundary for creating program indicator with boundary, programindicator relation having one to many relationship with periodboundary relation.

Thank you