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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,007)