I’m reading in a JSON file, deserializing, and now I want to make a change if a value doesn’t exist for example and save it back to the original file. Having trouble finding information about this much of the json forum posts are about parsing.
What do you think about this?
- Read JSON file
- Make changes into JObject
- Serialize JObject after changes. For this, you can use -> Newtonsoft.Json.JsonConvert.SerializeObject(variable)
- Use “Create file” activity, providing same name and path. This will replace old json file by a new blank json file.
- Use “Append Line” to write the new json content from the fourth step, to the new json file
If you think it is reasonable, please test it and let me know if it worked.
I actually figured it out and did something very similar, I just used assign activity instead for step 4. but thank you!