Best practise for bulk upload

Hello!

I want to collect for 5min the data on my server and made a bulk upload.

Right now I made:

http://domaincom/emoncms/input/bulk.json?data=[[-88,6,24],[-86,6,2412],[-85,6,2314],[-84,6,234],[-3,6,24,2412,2314],[-1,6,23]]&time=1429613063&apikey=bd10a9b18fa094f0xxxxxxxxxxxxxxxx

 

So far, so good ... but I want:

http://domaincom/emoncms/input/bulk.json?data=[[-88,6,24,,,3],[-86,6,,,2412],[-85,6,2314,,,,,8],[-84,6,234,,,,,9],[-3,6,24,2412,2314,,,6],[-1,6,23]]&time=1429613063&apikey=bd10a9b18fa094f0xxxxxxxxxxxxxxxx

Not all values has new values on same second. Can I use "null" in bulk upload? He accept the "null" but made it problems in database? Or is there another "null" possiblility?

I can´t use "0", because then he wrote in the database the value 0.

 

Thank you!

Edit - masked API key - BT

unique24's picture

Re: Best practise for bulk upload

ok, this doesn´t work:

http://domain.com/emoncms/input/bulk.json?data=[[-7,4,34,null,null,null,null,null,null,null,null,null],[-4,4,null,null,,null,null,null,null,null,null,null],[-2,4,null,null,244,null,null,null,null,null,null,null]]&time=1429614609&apikey=bd10a9b18fa094f0xxxxxxxxxxxxxxxx

 

but this:

http://domain.com/emoncms/input/bulk.json?data=[[-7,4,34,null,null,null,null,null,null,null,null,null]]&time=1429614609&apikey=bd10a9b18fa094f0xxxxxxxxxxxxxxxx

 

Edit - masked API key - BT

pb66's picture

Re: Best practise for bulk upload

The use of "null" (no quotes) should work, as in

http://domaincom/emoncms/input/bulk.json?data=[[-88,6,24,null,null,3],[-86,6,null,null,2412],[-85,6,2314,null,null,null,null,8],[-84,6,234,null,null,null,null,9],[-3,6,24,2412,2314,,,6],[-1,6,23]]&time=1429613063&apikey=abc123etc 

This feature was added to v8.3.5 so each individual value belonging to an input could be updated independently.

only null is accepted, spaces,omissions,Null,'null' "" " " etc will all prevent the frame from being processed as it is seen as an error. You can see it is working as intended as neither "Last updated" or the value will change when watched in the input page.

Selectable input updates

Paul

(ps you should "fudge" your apikey)

unique24's picture

Re: Best practise for bulk upload

Hi Paul,

 

perfect! Thanks for all informations!

unique24's picture

Re: Best practise for bulk upload

Hi Paul,

 

I try this now again and it seems not working:

http://emoncms.org/input/bulk.json?data=[[-4,1,-112.3,-251.35,-134.18,null,null,null,null,null,-497.83,null],[-1,1,-112.67,-251.36,-130.99,228.64,234.17,231.65,null,null,-495.02,null]]&time=1442384223&apikey=843b22d..

 

He update always all values with "null" with the value "0"

 

Did you changed something?

 

Thank you!

pb66's picture

Re: Best practise for bulk upload

To my knowledge there have been no (intended) changes but there has been a lot of development since that code was added. You could try just omitting the values eg  [only null will work]

http://emoncms.org/input/bulk.json?data=[[-4,1,-112.3,-251.35,-134.18,,,,,,-497.83,],[-1,1,-112.67,-251.36,-130.99,228.64,234.17,231.65,,,-495.02,]]&time=1442384223&apikey=843b22d.

Paul

pb66's picture

Re: Best practise for bulk upload

See the "emoncms input api issue" thread for more info, It has been confirmed this is still functional in emoncms v9.1 on local installs, but is currently broken on emoncms.org.

Paul

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.