cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CarlosMoreira70
Level: Powered On

Office365.CalendarGetTables() and language

I am basically willing to let the user select on which calendar some events should be saved to. Using Office365.CalendarGetTables() you can provide in a dropdown hss calendards. I would like to default the dropdown to the default calendar, but if it is a German user this calendar is named Kalender and in French Calendrier ... how should I go about defaulting to Calendar/Kalender/Calendrier/...?

4 REPLIES 4
Community Support Team
Community Support Team

Re: Office365.CalendarGetTables() and language

Hi @CarlosMoreira70 ,

Could you please share a bit more about your scenario?

Do you want to display a default Calendar name within the Dropdown box based on the user's local language?

 

Based on the issue that you mentioned, I think the Language function could achieve your needs. I have made a test on my side, please take a try with the following workaround:3.JPG

 

2.JPG

Set the Items property fo the Dropdown box to following:

DropColumns(
     AddColumns(
           Office365.CalendarGetTables().value, 
           "CalendarName", 
           If(
               DisplayName = "Calendar",
               If(                                 /* <-- Based on user's locale, display corresponding Calendar name value */
                   Right(Language(),2) = "US",
                   "Calendar",
                   Right(Language(),2) = "FR",
                   "Calendrier",
                   Right(Language(),2) = "DE",
                   "Kalender"
               ),
               DisplayName = "Birthdays",
               If(
                   Right(Language(),2) = "US",
                   "Birthdays",
                   Right(Language(),2) = "FR",
                   "Anniversaires",
                   Right(Language(),2) = "DE",
                   "Geburtstage"
               ),
               DisplayName = "United States holidays",
               If(
                   Right(Language(),2) = "US",
                   "United States holidays",
                   Right(Language(),2) = "FR",
                   "Vacances aux Etats-Unis",
                   Right(Language(),2) = "DE",
                   "USA Feiertage"
               )
           )
    ),
   "DisplayName"
)

Then set the Default property of the Dropdown box to following:

If(
    Right(Language(),2) = "US",
    "Calendar",
    Right(Language(),2) = "FR",
    "Calendrier",
    Right(Language(),2) = "DE",
    "Kalender"
)

More details about the Language function in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-language

 

If you want to reference the Calendar Id from above Dropdown box (to create events), please consider use the following formula:

Dropdown1.Selected.Name                /* <-- returns the Calendar Id for the selected Calendar name e.g. AAMkAGNlZWJhNDFhLWVkZDQtNGEwMi1hNGYxLWE4NjgxODQxYjE1OABGAAAAAADs9uoqJJanQrMetqhMVhx6BwCSaWLzoY45Rr_4uGphA-0GAAAAAAEGAACSaWLzoY45Rr_4uGphA-0GAAIdUAygAAA=*/

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CarlosMoreira70
Level: Powered On

Re: Office365.CalendarGetTables() and language

thank you.

I can already display the calendar names in the user local language, that is the default provided back by the Office365.CalendarGetTables().value

But I cannot set the default value as the displayname is different based on the user regional settings

A French user will get the drop down defaulted to "Anniversaire" the first in alphabetical order

I guess I could indeed write an extensive set of if clauses to cover the 25+ languages of the users of the app to default to the "calendar"...

Community Support Team
Community Support Team

Re: Office365.CalendarGetTables() and language

Hi @CarlosMoreira70 ,

Yeah, I agree with you. Based on the needs that you mentioned, I think there is no easy solution to achieve your needs.

 

As an available solution, I think the extensive set of if clauses may be a choice for you. I think the solution I provided above could achieve your needs, please consider take a try with it.

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CarlosMoreira70
Level: Powered On

Re: Office365.CalendarGetTables() and language

 

Actually it seems more challenging than that. See below although I have French as my O365 language and it is picked up properly with language() the values retrieved from  Office365.CalendarGetTables().value are in english in this specific case. But in 365 Outlook it is in French. Language() does not seem to be the right function to retrieve the name of the calendar. I have other cases where language() returns en-US and the Office365.CalendarGetTables().value returns Kalender ???

LangIssue.png

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,887)