Bringing JSON data to Notion (Not getting parts of JSON)

Hello there, I have been trying to export Health Data to my Notion.

I am capturing data from an app using a Webhook. The data is brought in successfully in a beautiful JSON file. (See first image)

I have tried bringing the data from the array Metrics directly into Notion, but it doesn’t allow this depth of data. The Notion step seems to only read the upper level Workouts Array and its data. (See second image)

I tried transforming the Metrics Array into a new JSON, then parsing each individual Metric collection into Notion using the JSON tool but it only gives me the first value from the Array. Not the other 22. (See third and fourth image)

How can I format this step to make sure I can transfer all Metrics from the Array into Notion?

Pepijn


second_image2

Hi @pepijnfs, what’s the target Notion property where you want to map those items from your Metrics array? What type of Notion property is it?

2 Likes

Hi Simo thanks for the reply > it are numerous database fields in my “Daily Tracking” Database.

They include text fields, number fields, date fields etc.

The one I am hovering over (“Title”) in the example is the Title for the Database Item in the Daily Tracking database, however it shows this (fourth image) for every property I select.

Is that what you were asking?

1 Like

Thanks @pepijnfs - it would be helpful if you can write exactly which field from your JSON needs to be mapped to which Notion property type. For example:

  • qty → number property

  • date → date property
    etc.

So that I can understand how we may map those values to the destination property

2 Likes

Hi there @Simo ,

For example I would like to map .qty of the metrics.data for the name value “active_energy” collection to a number field in Notion that has the name “Active Energy (kJ)”.

Second example would be to map the .qty of the metrics.data for the name value “resting_heart_rate” collection to a number field in Notion with the name for “Resting Heart Rate”.

This gets a little more complex later on, because some metrics.data contain multiple datapoints for one array (e.g. the array “Sleep Analysis” holds sleep time, to bed time, wake up time, deep sleep time etc.)

However I feel comfortable mapping these fields to Notion, when I can access these fields from the array in the Notion step. But like I mentioned before I am not seeing any of it and wouldn’t know how to take it from here :upside_down_face:

I see - it looks like this is a use-case for the get and map functions in Make. You could use those to access nested objects within your arrays. You can find those functions in the Make pop-up panel when you enter data into a Notion property. You may play around with those and see if you can get the values from your arrays. Feel free to post any updates here

1 Like

@Simo thank you! That worked like a charm.

Using the get function I wrote: {{get(1.data.metrics.data; “1.qty”)}}
… in order to get the first chronological value in the array data.metrics.

I did a test, giving my Notion row a “Title” that has this value and as you can see, it worked.

Thanks for your help!


1 Like