cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Newby_PPM
Frequent Visitor

Create event in Outlook with fields

Hello,

I would like to create a new event in Outlook with the data on the screen. Important are the date, the time, the calendar and the subject "photo appointment".

I used the code:
Office365.V2CalendarPostItem (Dropdown1.Selected.Name;Label1.Text;Date1Time.Text;Date1Time.Text)

But unfortunately, I don't have an event in the calendar. Unfortunately the time is missing too. Can somebody help me? That would be great.2019_04_26_08_57_48_Window.jpg

thanks a lot

many greetings

PPM

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Newby_PPM 

 

Give this formula a try instead:

Office365.V2CalendarPostItem(
    Dropdown1_1.Selected.Name;
    Subject.Text;
    Text(DateTimeValue(Datum2Termin.Text & " " & Uhrzeit2.Text);UTC);
    Text(DateTimeValue(Datum2Termin.Text & " " & Label3.Text);UTC)
);;
UpdateIf(
    TerminNR2;
    Uhrzeit = Dropdown4_7.Selected.Uhrzeit;
    {
        Mitarbeiter: Name.Text;
        Mail: eMail.Text;
        Telefon: Rufnr.Text
    }
)

See if that works for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@Newby_PPM 

Your Date1Time label appears to only contain a time.  You will need a date and time to use for your start and end times.  And, they should be in UTC.

 

Check your start and end time labels.  I believe that is where you are having issues.  In fact, my guess is that your formula is actually creating events, but it is using a default date...whatever that might be.

 

I hope that gives you some clues.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Newby_PPM
Frequent Visitor

Hello,

 

Hello,

the code writes the event to the calendar (Outlook Cloud). But it doesn't write the time in the appointment.

The time is in a text field. I tried to connect the field with a +.

 

Office365.V2CalendarPostItem (Dropdown1.Selected.Name;Label1.Text;Datum1Termin.Text + Uhrzeit1.Text;Datum1Termin.Text + Label2.Text )

Hello RansyHayes,

thank you for your answer. the code writes the event to the calendar (Outlook Cloud). But it doesn't write the time in the appointment.

The time is in a text field. I tried to connect the field with a +.

 

Office365.V2CalendarPostItem (Dropdown1.Selected.Name;Label1.Text;Datum1Termin.Text + Uhrzeit1.Text;Datum1Termin.Text + Label2.Text )

 

@Newby_PPM 

Have a go with the following formula:

Office365.V2CalendarPostItem(Dropdown1.Selected.Name;
Label1.Text;
DateTimeValue(Datum1Termin.Text & Uhrzeit1.Text);
DateTimeValue(Datum1Termin.Text & Label2.Text)
)

You may have issues with UTC depending on what is in the Text properties of the above controls and what their format would be.  You still may need to convert to UTC to get the times right.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello,

thanks for the tip that helps me further.

Unfortunately I now get the error "Error with "Office365.Error with "Office365.V2CalenderPostItem": The method "V2CalenderPostItem" has an invalid value for the parameter "Start". "

I added the UTC to the code. I tried it with different date formats, but always got the error again.

 

Office365.V2CalendarPostItem(
    Dropdown1_1.Selected.Name;
    Subject.Text;
   DateTimeValue((Datum2Termin.Text & Uhrzeit2.Text);UTC);
    DateTimeValue((Datum2Termin.Text & Label3.Text);UTC)
);;
UpdateIf(
    TerminNR2;
    Uhrzeit = Dropdown4_7.Selected.Uhrzeit;
    {
        Mitarbeiter: Name.Text;
        Mail: eMail.Text;
        Telefon: Rufnr.Text
    }
)

@Newby_PPM 

 

Give this formula a try instead:

Office365.V2CalendarPostItem(
    Dropdown1_1.Selected.Name;
    Subject.Text;
    Text(DateTimeValue(Datum2Termin.Text & " " & Uhrzeit2.Text);UTC);
    Text(DateTimeValue(Datum2Termin.Text & " " & Label3.Text);UTC)
);;
UpdateIf(
    TerminNR2;
    Uhrzeit = Dropdown4_7.Selected.Uhrzeit;
    {
        Mitarbeiter: Name.Text;
        Mail: eMail.Text;
        Telefon: Rufnr.Text
    }
)

See if that works for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello,

I solved the problem. The date and time must be in a field and the formats of the data must be correct. Many thanks again

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

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.

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