cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radoslavov
Continued Contributor
Continued Contributor

Count all meeting slots

Hi guys,

 

I'm using Power Automate to check my calendar for available slots of let's say 30 minutes.

The flow works fine, the output shows all available 30 min slots in my calendar, but what I want it somehow to summarize them all, so i can pass the result to Power Virtual Agent.

For example: "you have 5 available slots of 30 minutes in your calendar"

Radoslavov_0-1608201413281.png

this is the output

[
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T00:00:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T00:30:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T16:00:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T16:30:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T16:30:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T17:00:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T17:00:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T17:30:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T17:30:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T18:00:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T18:00:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T18:30:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T18:30:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T19:00:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T19:30:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T20:00:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T22:00:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T22:30:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T22:30:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T23:00:00.0000000",
        "timeZone""UTC"
      }
    }
  },
  {
    "confidence"100,
    "organizerAvailability""free",
    "attendeeAvailability": [],
    "locations": [],
    "meetingTimeSlot": {
      "start": {
        "dateTime""2020-12-18T23:00:00.0000000",
        "timeZone""UTC"
      },
      "end": {
        "dateTime""2020-12-18T23:30:00.0000000",
        "timeZone""UTC"
      }
    }
  }
]
 
Any suggestions what ste[/steps to add to summarize the results from this step?
 
Regards
1 ACCEPTED SOLUTION

Accepted Solutions
Radoslavov
Continued Contributor
Continued Contributor

I found the solution to count all items in an array by using the following formula fro compose step

Radoslavov_1-1608295454298.png

 

length(variables('SlotNumber'))

Radoslavov_0-1608295433378.png

this way I get a value of all items in an array which in my cases there are available slots in my calendar

View solution in original post

6 REPLIES 6
VictorIvanidze
Community Champion
Community Champion

Hi @Radoslavov, it seems you have just use "for each"  cycle - what's the problem?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

"what I want it somehow to summarize them all, so I can pass the result to Power Virtual Agent.

For example: "you have 5 available slots of 30 minutes in your calendar"

 

Count all as one total number

Radoslavov
Continued Contributor
Continued Contributor

I found the solution to count all items in an array by using the following formula fro compose step

Radoslavov_1-1608295454298.png

 

length(variables('SlotNumber'))

Radoslavov_0-1608295433378.png

this way I get a value of all items in an array which in my cases there are available slots in my calendar

Could you please explain where and how did you set the variable 'SlotNumber'?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Sure, I've created an array (called SlotNumber) that stored all available outputs from my calendar

Radoslavov_0-1608296732252.png

Then in the count all available slots step I'm using the output from the array.

VictorIvanidze
Community Champion
Community Champion

I  believe there exists an alternative:

length(outputs('Find_meeting_times_(V2)')?['body/meetingTimeSuggestions'])
--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,081)