@samliew has a great answer above but can I recommend my Make for Newbies video series to learn about accessing data structures? It will enlighten and serve to increase your understanding so you don’t just end up mashing stuff together willy nilly and act from a position of knowledge/experience.
Actually it’s not simple at all. The Make element picker UI (the icon in the Make element picker) doesn’t make this easy at all!
If you don’t understand the object path (ie dot notation) to reference the correct array for the map() function. You see 1.body.collection.1.rules
argument in the map() function that @samliew entered? That’s not something you can click on in the Make UI and have to write it out.
But it means this:
Look in module 1 (1.)
then look in the collection called body
(body.)
then look in the array called collection
(collection.)
then look in the first element of the collection array (1.)
then look in the array called rules
(rules.)
The object path 1.body.collection.1.rules
tells the map() to look in that nested array called rules.
The second/third/fourth arguments to map tells it to select the intervals
array but only for elements on the rules array where the wday
key is equal to monday
The first() call that surrounds the map() call extracts the 1st element from the array which is the from: and to: values (09:00 and 10:00 in your example)
If you use last() around the same map() function you will get 12:00 and 14:00 which is the last element of the intervals
array.
Make sense? Seriously watch my Make for Newbies series right from start. You’ll be happy you did.
–
Alex Sirota
Director of NewPath Consulting - we are Make Heroes!
Check out my series of videos and scenario walkthroughs for Make Newbies