Export Hierarchy Config as CSV Would be Very Useful
If we could get the hierarchy exported into excel as a csv then it would be very useful in replicating and generating the record structure for very large projects.
The current methodology of externally converting json to csv and back again is extremely difficult to work with successfully. We have a project with 306 devices each with 50 points and it would be useful to generate the hierarchy in excel with properly tagged xid's for import.
Any suggestions on achieving this welcomed!!
I agree, this would be a very helpful feature. Here is a python script that might help you in the mean time. It takes a CSV file with up to 4 folders deep and turns it into a point hierarchy json.
The 2-3 folder columns can be empty. make sure the csv is sorted first by folder 1 column, then 2, 3 and 4 so they are all grouped together.
The device name column isn't used just helpful for reference.
On your command line navigate into the folder with the csv and script and run the script like: "python csvtojson-pointHierarchy.py" and you will get a file called output.json
@joelhaggar said in Export Hierarchy Config as CSV Would be Very Useful: I tried this but the script generated this error ? Is my format correct?
Folder 1 Folder2 Foulder3 Foulder4 xid Device Name
VUZE Tenant Sub-Metering Unit-101
Potable Water DP_Com1_101-00334
Unit-102 Admin DP_Com1_102-00315
You need the folder 1, 2, 3 & 4 for every row / xid. You should not have any blank folder 1 folders.
OMG It worked beautifully thanks Joel. :)
@phillip-weeks Hi Joel.. I imported the hierarchy perfectly into our R&D ES but using the same hierarchy json file for the production ES
produces no confirmations or errors however it does not update the hierarchy structure either.
Both ES servers are running the same mango versions and have the same data point structures imported from the same data,
I have re-tried importing and even restarted mango and reimported but each time it behaves the same.
What should I look for as the possible cause of such a behaviour?
Thanks in advance
That's interesting. I'd check the ma.log file. Also what UI are you using? I would try the both the legacy and the new UI for JSON import and see if you have any difference.
Is there some length limit to the json? because I tried uploading the output.json as well as drag and dropping the file into UI of both new ES servers... the import window remained blank and at 0% for 15 minutes until I cancelled it. However, using the legacy method one ES server imports the json correctly as I can paste right into the window which I can't seem to do in the new UI.
Interestingly I replicated my Data sources and re-imported the json with a different prefix tag on the DS and DP id's and the hierarchy did import into the second server this time so I suspect I some error on the original Data source setup because I had some original issues with the import and a couple property templates missing. When I originally created the data source some points got left out because the property template was not in the new system at that point and I did not realize this and imported the hierarchy which expected these points and did complain about missing points, which I then added in a smaller import. the legacy hierarchy import didn't work after that point. The new UI import never worked at all. All good now! , somehow (magically) all data sources slotted into the correct hierarchy after the last json import which had the prefix on the point ids.