cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radoslavov
Post Patron
Post Patron

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
Post Patron
Post Patron

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
Resident Rockstar
Resident Rockstar

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



Freelance Power Automate developer. $50 per hour.

"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
Post Patron
Post Patron

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

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



Freelance Power Automate developer. $50 per hour.

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
Resident Rockstar
Resident Rockstar

I  believe there exists an alternative:

length(outputs('Find_meeting_times_(V2)')?['body/meetingTimeSuggestions'])


Freelance Power Automate developer. $50 per hour.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,849)