cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radoslavov
Responsive Resident
Responsive Resident

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

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

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
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.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,999)