<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Show Data Point Name as Column in Watch List CSV Download]]></title><description><![CDATA[<p dir="auto">We created a watch list that select data points based on tags and its functioning exactly as we need, however, we have some usability problems with the way the CSV download file is created.</p>
<p dir="auto">When we do CSV download separate value columns the column header is the XID which is not useful.</p>
<p dir="auto">Also the time step of the data seems to change based on the duration of time data is selected for.</p>
<p dir="auto">Our desired function would have to use tags to select data points. Then be able to download the data at high resolution and have the column header be DataPointName, or preferably DeviceName - DataPointName.</p>
<p dir="auto">Any thoughts on how to get the CSV formatted like this would be great.</p>
<p dir="auto">Thanks in advance.</p>
]]></description><link>https://forum.mango-os.com/topic/4252/show-data-point-name-as-column-in-watch-list-csv-download</link><generator>RSS for Node</generator><lastBuildDate>Tue, 12 May 2026 13:06:48 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4252.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Jun 2019 21:14:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Show Data Point Name as Column in Watch List CSV Download on Mon, 19 Aug 2019 13:02:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi cwangv,</p>
<blockquote>
<p dir="auto">Barring an up-coming enhancement in the near future, would you recommend me use a custom XID instead of the one generated by Mango to overcome this issue? for example, I could name an XID as 'METER-1_KWH'. Does Mango software check the uniqueness of XID when it is entered? If it does, I think entering XID by hand can be a solution to this.</p>
</blockquote>
<p dir="auto">I have personally always believed in custom XIDs, and have always encouraged people to think of them as another identifier field. Others disagree with me, and I haven't been able to understand the reasoning presented. Something about more work if it has to change later? I can't say.</p>
<p dir="auto">Yes Mango checks the uniqueness of the XID. You could generate XIDs for all the points and update them via SQL, or if it's a fresh system you could use JSON import, but since neither CSV nor JSON import can change an XID, you must use the SQL console or change them by hand, which would be the more work to change later argument. But, it'll make the data download more readable without having to wait for the git issue to be addressed, and it'll make any dashboards' code more legible.</p>
]]></description><link>https://forum.mango-os.com/post/23185</link><guid isPermaLink="true">https://forum.mango-os.com/post/23185</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Mon, 19 Aug 2019 13:02:05 GMT</pubDate></item><item><title><![CDATA[Reply to Show Data Point Name as Column in Watch List CSV Download on Sun, 18 Aug 2019 02:37:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a><br />
Hi, Phil<br />
I am glad that I have found this post which has expressed the exact same issue I will have with the heading format.<br />
In some of our projects, we may have to generate hundreds of reports. I understand the solution you suggested can work on occasions that only have<br />
a handful of meters.<br />
There is no update on the GitHub about the enhancment.<br />
Barring an up-coming enhancement in the near future, would you recommend me use a custom XID instead of the one generated by Mango to overcome this issue? for example, I could name an XID as 'METER-1_KWH'. Does Mango software check the uniqueness of XID when it is entered? If it does, I think entering XID by hand can be a solution to this.</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.mango-os.com/post/23181</link><guid isPermaLink="true">https://forum.mango-os.com/post/23181</guid><dc:creator><![CDATA[cwangv]]></dc:creator><pubDate>Sun, 18 Aug 2019 02:37:34 GMT</pubDate></item><item><title><![CDATA[Reply to Show Data Point Name as Column in Watch List CSV Download on Thu, 13 Jun 2019 19:26:52 GMT]]></title><description><![CDATA[<p dir="auto">Hi chio,</p>
<p dir="auto">Currently this option does not exist, but it would be pretty easy to use a JSON export and a python script to rewrite the file something like...</p>
<pre><code>import json

configFile = open("/path/to/config.json", encoding='utf-8')
config = json.load(configFile)
configFile.close()

csvData = open("/path/to/data.csv", "r")
xidLine = csvData.readline()

# Assume no commas, quotes or newlines in the XIDs
xids = xidLine.replace("\r", "").replace("\n", "").replace("\"", "").split(",")[1:]
#print(xids)

xidMap = {}
for dp in config["dataPoints"] :
    xidMap[dp["xid"]] = dp
	
newFirstLine = "\"timestamp\""
for xid in xids :
	newFirstLine += ",\"" + xidMap[xid]["deviceName"] + " - " + xidMap[xid]["name"] + "\""
newFirstLine += "\n"	

#print(newFirstLine)
outputFile = open("/path/to/output.csv", "w+")
outputFile.writelines(newFirstLine)
outputFile.writelines(csvData.readlines())
outputFile.close()
csvData.close()
</code></pre>
<p dir="auto">Definitely we see what you're saying and that you've added weight in the discussion that the available formats could be more flexible. I think the original XIDs as headers was done in anticipation of providing a multicolumn data upload, but no such feature exists currently.</p>
<p dir="auto">I have created a git issue about it: <a href="https://github.com/infiniteautomation/ma-core-public/issues/1436" rel="nofollow ugc">https://github.com/infiniteautomation/ma-core-public/issues/1436</a></p>
]]></description><link>https://forum.mango-os.com/post/22418</link><guid isPermaLink="true">https://forum.mango-os.com/post/22418</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 13 Jun 2019 19:26:52 GMT</pubDate></item></channel></rss>