Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Get calendarID based on Form input

(0) ShareShare
ReportReport
Posted on by

I have a form that my sales people fill out. It has various inputs including a start and end date for promotions. There is also the type of promotion field "Type of PRF". This is chosen from a choice menu. Each choice available is the exact same name as the calendar that the meetings exist on. Example "On-Air Giveaway" choice would go on the "On-Air Giveaway" shared calendar. 

 

I would like to Create event - getting the Calendar ID from the "Type of PRF" dynamic data provided in the form. I have no problems getting the dates correct. Just choosing the Calendar ID based on the user's input. Please help. Screen shot attached for reference.

  • creativeopinion Profile Picture
    10,396 Super User 2025 Season 1 on at
    Re: Get calendarID based on Form input

    @Zpierucci For testing purposes, I would recommend you create a New Flow with a manual trigger. This will help you to figure out the logic to the flow you are trying to build.

    How to Get a Calendar ID

    Add a Scope action. This will make it easy to copy/paste these actions into your working flow. Insert the rest of your actions inside the Scope action.

     

    Insert the Get Calendars (V2) action. 

     

    Add an Apply to each action to loop through all the Calendars returned. Add a Compose action to store the Calendar Name and the Calendar ID.

     

    Insert the value Name and value ID dynamic content into the respective Compose action. 

     

    creativeopinion_13-1696556761682.png

     

    Run a test. Take a look at the outputs of the test. Review all the Calendar Names returned. Note: If you are using a Shared Calendar—it must be added to Outlook first before you run this test. 

     

    Take note of the calendar names — we'll be using it in the next action. 

    creativeopinion_1-1696555224996.png

     

    Delete the Apply to each action. 

     

    Add a Placeholder

    Since you'll be moving these actions to your working flow. Add a Compose action to store placeholder text for your Calendar. This way you can easily replace it with the dynamic content from your form.

     

    Enter any Calendar name into the Compose action. 

    creativeopinion_7-1696556331796.png

     

    Filter Array

    The Get Calendars (V2) action will return an array of Calendars. To filter out a specific calendar—use a Filter Array action. It's a lot more efficient than an Apply to Each and Condition action. To learn more about how to use the Filter Array action, please refer to this recent YT Tutorial I uploaded.

     

    In the From field insert the value dynamic content from the Get Calendars (V2) action.

     

    In the first value field insert the value Name dynamic content. Leave the operator as is equal to (unless it's not an exact match) — in which case you can use the contains operator. 

     

    In the second value field insert the outputs from the Compose action above.

    creativeopinion_8-1696556368606.png

    Run a test. Review the outputs to ensure that your calendar is being returned. If the outputs display a [] this means no calendars were returned.

     

    You'll need the dynamic content key for the next action where we'll return the calendar id. All dynamic content can be returned with an expression. You will need to know key for the content. The key is the text in red between the double quotes.

     

    creativeopinion_4-1696556160857.png

     

    Get the Calendar ID

    Insert a Compose action. Add an expression. The Filter Array action will return an array of results. Even if you return a single item.

     

    To access the ID of the item returned you need to use a [0] in the expression (to get the first item of the array).

     

    Start the expression off by entering in

    ?[0]['id]

    creativeopinion_5-1696556193452.png

     

    Place your cursor at the start of the expression. Tip: Press the up arrow key. Click on the dynamic content tab and insert the Body dynamic content from the Filter Array action. 

     

    creativeopinion_6-1696556231755.png

     

    Copy/Paste the Scope Action

    Click on the 3 dots of the Scope action and select Copy to my clipboard.

     

    creativeopinion_9-1696556395746.png

     

    In your working flow, insert the Scope action where appropriate. 

    creativeopinion_10-1696556478291.png

    Click on the My Clipboard tab and insert your Scope action.

    creativeopinion_11-1696556519643.png

     

    Replace the Placeholder Content

    In the Compose action storing the Calendar name, replace the placeholder content. This is assuming the text from the form matches the Calendar name. 

    creativeopinion_12-1696556574280.png

     

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉Watch my tutorials on YouTube
    👉Tips and Tricks on TikTok

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow