web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Working with Datasets ...
Power Apps
Answered

Working with Datasets and dataset parameters - API enhancements

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

So i love how with standard field types, if i want to get a value I can do this, and it gets picked up by vs code:

 

this._value = context.parameters.INPUTFIELDNAME.raw;

With datasets though I need to do this:

 valuePara.textContent = gridParam.records[currentRecordId].getFormattedValue("INPUTFIELDNAMESTR");

It would be nice if the API allowed me to do this:

context.dataset[i].INPUTFIELDNAME.raw

I know it's a minor thing, but if you look at that dataset example.. there's alot of code just to sort columns, then grab a record, then build a grid:

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/sample-controls/data-set-grid-control

 

I'm thinking we can probably replace several functions and achieve the same with a single method that looks like this:

/** pseudocode **/

context.dataset.sort(sortonthiscolumn);
for(int i=0; i<dataset.length; i++){ console.log (context.dataset[i].columnname.value); }

Does that make sense or am I just being lazy? 😄

 

I have the same question (0)
  • Verified answer
    MannyGrewal Profile Picture
    40 on at

    Hi Andrew, 

     

    My understanding is that getSortedColumnsOnView() is just an optional method. It just removes system columns and sorts the columns. You can choose to skip it.

     

    It seems that dataset is a dictionary object, rather than an Array object. However, it is also logical to query data records by GUID rather than by index (1,2,3...N)

     

    The SDK does give you a list of the all the GUIDs through the DataSet.sortedRecordIds() method which you can use to traverse the whole Dictionary like below

     

    for(let currentRecordId of DataSet.sortedRecordIds){

       let name = DataSet.records[currentRecordId].getFormattedValue(columnItem.name);

    }

     

    I agree with you that DataSet's API can be refined bit more to make is easily consumable but there may be internal complexities in refactoring its collections. Hopefully better by GA.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Given no more responses.. I will accept your solution sir Smiley LOL

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard