PowerApps icon indicating copy to clipboard operation
PowerApps copied to clipboard

MeetingCaptureV2: Language/Locale issue with Calendar

Open p0shkar opened this issue 5 years ago • 0 comments

Thanks for making a great app!

I installed it today and got it working great - for me. However, when my users started it they recieved error that MyCalendarID was null. I tracked this down to them running Office in Swedish, while I as an admin naturally run everything in English, and the code was hardcoded to "Calendar".

Original Code:

Set(
    MyCalendarID,
    LookUp(
        Office365.CalendarGetTables().value,
        DisplayName = "Calendar"
    ).Name
);

My fix:

Set(
    MyLanguage, 
    Language()
);
If(
    MyLanguage = "sv-SE",
    Set(
        MyCalendarLanguage,
        "Kalender"
    ),
    Set(
        MyCalendarLanguage,
        "Calendar"
    )
);
Set(
    MyCalendarID,
    LookUp(
        Office365.CalendarGetTables().value,
        DisplayName = MyCalendarLanguage
    ).Name
);

I know there probably is a better way to do this, and possibly by using Language() in a more dynamic way for all languages, but I'm new to the PowerApps language (took me half the day to find and make this small fix) so I'll leave that up to the pros.

Hope this "fix" may help others anyway :)

p0shkar avatar Oct 30 '19 15:10 p0shkar