Home

Change values in many JSON file often - What is the best way?

%3CLINGO-SUB%20id%3D%22lingo-sub-530869%22%20slang%3D%22en-US%22%3EChange%20values%20in%20many%20JSON%20file%20often%20-%20What%20is%20the%20best%20way%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-530869%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20update%20prices%2Fvalues%20often%20in%20many%20JSON%20files.%20The%20reason%20why%20is%2C%20that%20Gravity%20forms%20for%20products%20in%20a%20webshop.%20A%20form%20import%2Fexport%20for%20Gravity%20forms%20can%20only%20be%20an%20JSON%20file%2C%20and%20have%20to%20have%20the%20excact%20same%20structure%20as%20the%20original.%20My%20data%20which%20is%20updated%20often%2C%20it's%20in%20excel%2C%20and%20I%20was%20looking%20for%20a%20solution%20where%20I%20could%20copy%2Fpaste%20it%20from%20excel%20to%20the%20JSON%20file%20somehow%20or%20similar.%20The%20basicPrice%20is%20an%20example%20(line%2012%20from%20the%20bottom).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20been%20searching%20for%202%20days%20for%20a%20good%20solution.%20A%20mix%20of%20power%20query%2C%20online%20converters%20from%20JSON%2C%20CSV%20and%20back%20to%20JSON%2C%20and%20then%20PHPStorm.%20The%20only%20solution%20so%20far%20i%20came%20across%20is%20PHPStorm%2C%20then%20format%20the%20JSON%20file%20and%20manually%20go%20through%20it%2C%20but%20it's%20too%20time%20consuming.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%20%22type%22%3A%22product%22%2C%20%22id%22%3A158%2C%20%22label%22%3A%22Pr.%20opfyldning%22%2C%20%22adminLabel%22%3A%22DG%20TEST%201%2Fdag%2012md%20kontant%22%2C%20%22isRequired%22%3Afalse%2C%20%22size%22%3A%22medium%22%2C%20%22errorMessage%22%3A%22%22%2C%20%22visibility%22%3A%22visible%22%2C%20%22inputs%22%3A%5B%20%7B%20%22id%22%3A%22158.1%22%2C%20%22label%22%3A%22Navn%22%2C%20%22name%22%3A%22%22%20%7D%2C%20%7B%20%22id%22%3A%22158.2%22%2C%20%22label%22%3A%22Pris%22%2C%20%22name%22%3A%22%22%20%7D%2C%20%7B%20%22id%22%3A%22158.3%22%2C%20%22label%22%3A%22Antal%22%2C%20%22name%22%3A%22%22%20%7D%20%5D%2C%20%22inputType%22%3A%22singleproduct%22%2C%20%22enablePrice%22%3Anull%2C%20%22formId%22%3A72%2C%20%22description%22%3A%22%22%2C%20%22allowsPrepopulate%22%3Afalse%2C%20%22inputMask%22%3Afalse%2C%20%22inputMaskValue%22%3A%22%22%2C%20%22inputMaskIsCustom%22%3Afalse%2C%20%22maxLength%22%3A%22%22%2C%20%22labelPlacement%22%3A%22%22%2C%20%22descriptionPlacement%22%3A%22%22%2C%20%22subLabelPlacement%22%3A%22%22%2C%20%22placeholder%22%3A%22%22%2C%20%22cssClass%22%3A%22%22%2C%20%22inputName%22%3A%22%22%2C%20%22noDuplicates%22%3Afalse%2C%20%22defaultValue%22%3A%22%22%2C%20%22choices%22%3A%22%22%2C%20%22conditionalLogic%22%3A%7B%20%22actionType%22%3A%22show%22%2C%20%22logicType%22%3A%22all%22%2C%20%22rules%22%3A%5B%20%7B%20%22fieldId%22%3A%22134%22%2C%20%22operator%22%3A%22is%22%2C%20%22value%22%3A%22Hver%2012%20m%5Cu00e5ned%22%20%7D%2C%20%7B%20%22fieldId%22%3A%22142%22%2C%20%22operator%22%3A%22is%22%2C%20%22value%22%3A%22Kontant%22%20%7D%20%5D%20%7D%2C%20%22productField%22%3A%22%22%2C%20%22basePrice%22%3A%226.885%2C00%20kr.%22%2C%20%22disableQuantity%22%3Atrue%2C%20%22multipleFiles%22%3Afalse%2C%20%22maxFiles%22%3A%22%22%2C%20%22calculationFormula%22%3A%22%22%2C%20%22calculationRounding%22%3A%22%22%2C%20%22enableCalculation%22%3A%22%22%2C%20%22displayAllCategories%22%3Afalse%2C%20%22useRichTextEditor%22%3Afalse%2C%20%22fields%22%3A%22%22%2C%20%22displayOnly%22%3A%22%22%20%7D%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-530869%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-530910%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20values%20in%20many%20JSON%20file%20often%20-%20What%20is%20the%20best%20way%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-530910%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F333542%22%20target%3D%22_blank%22%3E%40nicolaiibsen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20very%20much%20not%20my%20territory%20but%20is%20there%20anything%20here%20of%20value%20to%20you%3F%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Framblings.mcpher.com%2FHome%2Fexcelquirks%2Fjson%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Framblings.mcpher.com%2FHome%2Fexcelquirks%2Fjson%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20would%20regard%20Bruce%20McPherson's%20writing%20as%20pretty%20authoritative.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-530918%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20values%20in%20many%20JSON%20file%20often%20-%20What%20is%20the%20best%20way%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-530918%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20respons%2C%20and%20it's%20not%20my%20%3CSPAN%3Eterritory%20as%20you%20most%20likely%20can%20guess%20%3A-)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20have%20been%20reading%20it%2C%20but%20could'nt%20make%20it%20work%20so%20far.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
nicolaiibsen
New Contributor

I need to update prices/values often in many JSON files. The reason why is, that Gravity forms for products in a webshop. A form import/export for Gravity forms can only be an JSON file, and have to have the excact same structure as the original. My data which is updated often, it's in excel, and I was looking for a solution where I could copy/paste it from excel to the JSON file somehow or similar. The basicPrice is an example (line 12 from the bottom).

 

I've been searching for 2 days for a good solution. A mix of power query, online converters from JSON, CSV and back to JSON, and then PHPStorm. The only solution so far i came across is PHPStorm, then format the JSON file and manually go through it, but it's too time consuming.

 

{ "type":"product", "id":158, "label":"Pr. opfyldning", "adminLabel":"DG TEST 1/dag 12md kontant", "isRequired":false, "size":"medium", "errorMessage":"", "visibility":"visible", "inputs":[ { "id":"158.1", "label":"Navn", "name":"" }, { "id":"158.2", "label":"Pris", "name":"" }, { "id":"158.3", "label":"Antal", "name":"" } ], "inputType":"singleproduct", "enablePrice":null, "formId":72, "description":"", "allowsPrepopulate":false, "inputMask":false, "inputMaskValue":"", "inputMaskIsCustom":false, "maxLength":"", "labelPlacement":"", "descriptionPlacement":"", "subLabelPlacement":"", "placeholder":"", "cssClass":"", "inputName":"", "noDuplicates":false, "defaultValue":"", "choices":"", "conditionalLogic":{ "actionType":"show", "logicType":"all", "rules":[ { "fieldId":"134", "operator":"is", "value":"Hver 12 m\u00e5ned" }, { "fieldId":"142", "operator":"is", "value":"Kontant" } ] }, "productField":"", "basePrice":"6.885,00 kr.", "disableQuantity":true, "multipleFiles":false, "maxFiles":"", "calculationFormula":"", "calculationRounding":"", "enableCalculation":"", "displayAllCategories":false, "useRichTextEditor":false, "fields":"", "displayOnly":"" },

2 Replies

@nicolaiibsen 

This is very much not my territory but is there anything here of value to you?

http://ramblings.mcpher.com/Home/excelquirks/json

I would regard Bruce McPherson's writing as pretty authoritative. 

@Peter Bartholomew 

Thanks for respons, and it's not my territory as you most likely can guess :-)

 

I have been reading it, but could'nt make it work so far.