cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kosenurm
Super User
Super User

Create an event (v4) HELP

Hi, 

 

I have a problem with a Flow that I hope you can help with.     My flow is an instant Flow triggered from a button in PowerApps, which is all within a Solution. The Flow uses "Create an Event (v4)" action to add an event to the user's Outlook calendar. The Flow works great for me, but will not work for any other users. It tries to use my credentials which of course they do not have permission to use. I have tried recreating the Flow outside of the Solution in the hope of sharing as 'Run Only' but this doesn't work as it is an instant flow from Power Apps.   

 

Do you have any ideas of how I can use this action so that any user can have the information within the Flow added to their own Outlook calendar? 

 

The PowerApp is a desk booking app and the Flow is used to add a reminder to their own Outlook calendar.

 

Thanks

K

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @Kosenurm 

 

Change the format like below and try

Office365Outlook.V4CalendarPostItem(
    "Calendar",
    "Stalin Test 3", Text(
    DateAdd(
        DateTimeValue(DatePicker3.SelectedDate & " 8:00:00 AM"),
        TimeZoneOffset(),
        Minutes
    ),"dd/mm/yyyy hh:mm"), Text(
    DateAdd(
        DateTimeValue(DatePicker4.SelectedDate & " 8:30:00 AM"),
        TimeZoneOffset(),
        Minutes
    ),"dd/mm/yyyy hh:mm"),
    "(UTC) Coordinated Universal Time",
    {body: "Meeting Notes"}
)

 

View solution in original post

5 REPLIES 5
StalinPonnusamy
Super User
Super User

Hi @Kosenurm 

 

We can able to create a Calendar event/invite from PowerApps itself. Here is the code I'm using on my other project and I just replicated it for Forum and works fine. This creates a calendar event.

Office365Outlook.V4CalendarPostItem(
    "Calendar",
    "Stalin Test 3",
    DateAdd(
        DateTimeValue(DatePicker3.SelectedDate & " 8:00:00 AM"),
        TimeZoneOffset(),
        Minutes
    ),
    DateAdd(
        DateTimeValue(DatePicker4.SelectedDate & " 8:30:00 AM"),
        TimeZoneOffset(),
        Minutes
    ),
    "(UTC) Coordinated Universal Time",
    {body: "Meeting Notes"}
)

StalinPonnusamy_0-1633309511073.png

 

StalinPonnusamy_1-1633309511121.png

 

Please refer to my blog post for full details.

 

 

 

 

 

Thank you so much - this works.

 

However, my date picker is in UK format so is currently "dd-mm-yyyy" and when I have tried your code, it posts the event as "mm-dd-yyyy". Is there a way I can amend the date picker's date into this format and have the calendar event for the correct day?    

 

Thanks

K

StalinPonnusamy
Super User
Super User

Hi @Kosenurm 

 

Change the format like below and try

Office365Outlook.V4CalendarPostItem(
    "Calendar",
    "Stalin Test 3", Text(
    DateAdd(
        DateTimeValue(DatePicker3.SelectedDate & " 8:00:00 AM"),
        TimeZoneOffset(),
        Minutes
    ),"dd/mm/yyyy hh:mm"), Text(
    DateAdd(
        DateTimeValue(DatePicker4.SelectedDate & " 8:30:00 AM"),
        TimeZoneOffset(),
        Minutes
    ),"dd/mm/yyyy hh:mm"),
    "(UTC) Coordinated Universal Time",
    {body: "Meeting Notes"}
)

 

@StalinPonnusamy 

 

Thanks for the advice but I am getting this error???

 

error.png

StalinPonnusamy
Super User
Super User

Hi @Kosenurm 

 

Ideally, no need to convert the format. Your Power platform, Office 365 is the same tenant. Date format based on the region.

 

  • Can you show me the Date picket what it shows
  • Verify the region for your power platform
    • Go to Power Platform Admin Center
    • Select the environment
    • Click "See all" under the details section

StalinPonnusamy_0-1633372070483.png

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,530)