waistline icon indicating copy to clipboard operation
waistline copied to clipboard

Export food

Open wonzling opened this issue 11 months ago • 2 comments

open Is it possible to export the food in Json? I can give them to my wife, which have started just now, while I used the App just a while. Thanks.

wonzling avatar Mar 02 '24 15:03 wonzling

You can use the backup feature under Settings > Import/Export > Backup Database to write all of the app's data to a JSON file. You then need to locate the file on your phone (if you're on Android 13 or above you may need this file browser app to access the folder) and copy it to a PC where you can open it with a text editor and remove all the diary entries and other data from it that you don't want to move over to your wife's phone. Finally, you send the file to your wife and she imports it in her app via Settings > Import/Export > Import from Backup. Easy 😀

Edit: If your wife has already started to use the app and already has some foods and diary entries, then it's a bit more complicated. You would need to also export the JSON file from your wife's phone and manually merge them with the JSON file from your phone somehow.

EmilJunker avatar Mar 02 '24 16:03 EmilJunker

Thank you, your message was very helpfull, the correct json code to import via Backup function is like this: [ {

"foodList": [
	{
		"portion": "1",
		"id": 1,
		"dateTime": "2024-02-10T07:28:28.888Z",
		"barcode": "8017596122186",
		"unit": "Scheibe",
		"image_url": "undefined",
		"nutrition": {
			"kilojoules": 9.38,
			"calories": 9.38,
			"fat": 0.01,
			"saturated-fat": 0,
			"carbohydrates": 0.43,
			"sugars": 0.03,
			"fiber": 0.05,
			"proteins": 0.07,
			"salt": 0.01,
			"sodium": 5.2
		},
		"name": "TEST",
		"brand": "Alpenspitz - Eurospin",
		"archived": true
	}
],
"version": 33

} ](url)

wonzling avatar Mar 03 '24 05:03 wonzling