cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sheldoncopper73
Resolver I
Resolver I

Can the undocumented but available functions be used?

Hello Experts, 

 

For one of the scenario, I need to retrieve the Organization Settings. 

 

While debugging the context, I stumbled across one of the property, that can provide me the required values. 

 

Like, I'd want to know the First Day of the Week, which can be obtained by using the below line of code as per the data seen at the time of debugging (please see screenshot) .

Code: context.formatting._currentCultureInfo.dateTimeFormat.firstDayOfWeek

Screenshot:

ConsoleDataPCFContext.png

 

@jopursle  @v-monli-msft  @v-xida-msft  @AnqiChen So, wanted to understand, can I use the above line of code? If not, then what would be the right approach to achieve it?

 

Thanks,

Sheldon

1 ACCEPTED SOLUTION

Accepted Solutions

It looks like it's supported in our typing file through:

context.userSettings.dateFormattingInfo.firstDayOfWeek

 

It's also documented

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/dateformattinginf...

View solution in original post

5 REPLIES 5
rajyraman
MVP

MikeHuguet
Power Apps
Power Apps

In general, if an API is not documented, then it is subject to change and usage of it is not supported nor recommended.

HemantG
Power Apps
Power Apps

You should not use the undocumented APIs on the context object. For this particular case you can use WebAPI to retrive the value from the cds server and then cache it locally using setControlState for faster rendering for subsequent control load. 

 

Hemant 

It looks like it's supported in our typing file through:

context.userSettings.dateFormattingInfo.firstDayOfWeek

 

It's also documented

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/dateformattinginf...

View solution in original post

Thanks @AnqiChen for your help!

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,930)