03-13-2024 01:47 PM
Hello Everyone!
I manage a daily newsletter. To measure user engagement, we categorize users by how many emails they open per week.
I'm facing trouble using the export file from "Export Users By Segment" API endpoint. here is my workflow:
How can i parse the exported user details to look readable, like the sample braze response? this will make it tons easier to understand and therefore work with the data.
Here is what the (dummy) data looks like
vs what i want it to look like:
Thanks a lot!!
03-18-2024 05:27 AM
Hey! You can use a simple JSON formatter or do it directly in your Python script.
Here one simple example:
import json
# JSON string
json_string = '{"name": "John", "age": 30, "city": "New York"}'
# Convert JSON string to Python dictionary
data = json.loads(json_string)
# Convert Python dictionary back to JSON string with indentation
formatted_json = json.dumps(data, indent=4)
print(formatted_json)