How do i add in sorting for rest api data displayed in records table?

How do I add in sorting for the rest api data that is displayed in a records table? I want to sort from ascending A-Z and also ascending numbers when I click on the column header. I am unsure of what to set as the destination and how to configure that action after adding in list_sort column.

URL: http://loo-chujun.outsystemscloud.com/cc/Entry1.aspx?_ts=637267802167619589

I have attached an OML file.

Hi Loo Chu Jun,

What you can do this by creating the clientside function and taking a sort value in local variable. IN this client side function you define sorting on your aggregate .

REFER TO CLIENT SIDE FUNCTION (replace aggregate with yours)


Arjun Sharma wrote:

Hi Loo Chu Jun,

What you can do this by creating the clientside function and taking a sort value in local variable. IN this client side function you define sorting on your aggregate .

REFER TO CLIENT SIDE FUNCTION (replace aggregate with yours)


Hi Arjun Sharma,

I did not use aggregate for my data. I consumed the data from a rest api and hence there is no aggregate. How do i refresh the rest api data as the Refresh function requires the data source but my data source is from the api?


Hi Loo Chu Jun,

You can do this using external data source as well, please see screenshots below:


Hi, 

I have applied at column sort (asc or desc) on country and Deaths column in table record. You can check it now.



Thanks and Regards,

Rahul

Loo Chu Jun wrote:

Arjun Sharma wrote:

Hi Loo Chu Jun,

What you can do this by creating the clientside function and taking a sort value in local variable. IN this client side function you define sorting on your aggregate .

REFER TO CLIENT SIDE FUNCTION (replace aggregate with yours)


Hi Arjun Sharma,

I did not use aggregate for my data. I consumed the data from a rest api and hence there is no aggregate. How do i refresh the rest api data as the Refresh function requires the data source but my data source is from the api?



Hi Loo Chu Jun,

Let me me understand it more that your rest API contains sorting parameter or not. If yes then you can replace aggregate mentioned with rest API function. if No then you need fetch and data put in aggregate and sort (this will be tedious and heavy)

Arjun Sharma wrote:

Loo Chu Jun wrote:

Arjun Sharma wrote:

Hi Loo Chu Jun,

What you can do this by creating the clientside function and taking a sort value in local variable. IN this client side function you define sorting on your aggregate .

REFER TO CLIENT SIDE FUNCTION (replace aggregate with yours)


Hi Arjun Sharma,

I did not use aggregate for my data. I consumed the data from a rest api and hence there is no aggregate. How do i refresh the rest api data as the Refresh function requires the data source but my data source is from the api?



Hi Loo Chu Jun,

Let me me understand it more that your rest API contains sorting parameter or not. If yes then you can replace aggregate mentioned with rest API function. if No then you need fetch and data put in aggregate and sort (this will be tedious and heavy)

Hi Arjun Sharma,

My API does not contain the sorting parameter. How do i fetch the api data and put in into aggregate and sort?



Rahul Kumar wrote:

Hi, 

I have applied at column sort (asc or desc) on country and Deaths column in table record. You can check it now.



Thanks and Regards,

Rahul

Hi Rahul Kumar,

The sorting for the column deaths do not work.

Thank you.


Regards,

Chu Jun

Loo Chu Jun wrote:

Rahul Kumar wrote:

Hi, 

I have applied at column sort (asc or desc) on country and Deaths column in table record. You can check it now.



Thanks and Regards,

Rahul

Hi Rahul Kumar,

The sorting for the column deaths do not work.

Thank you.


Regards,

Chu Jun

Hi, 

I am sorry , it does not work for Deaths column . You can create another OnNotify for Deaths column where you need to ListSort By Deaths and Ascending with Check , as i do for country column. Now you have separate OnNotify for both so there do not need of If condition  in By attribute of ListSort. You just simply put column name in By.


I think, Another way  to do , creating Entity for Rest API response  and use OutSystems scaffolding to generate your screens and have all sorting logic in place automatically.


Thanks and Regards,

Rahul


Rahul Kumar wrote:

Loo Chu Jun wrote:

Rahul Kumar wrote:

Hi, 

I have applied at column sort (asc or desc) on country and Deaths column in table record. You can check it now.



Thanks and Regards,

Rahul

Hi Rahul Kumar,

The sorting for the column deaths do not work.

Thank you.


Regards,

Chu Jun

Hi, 

I am sorry , it does not work for Deaths column . You can create another OnNotify for Deaths column where you need to ListSort By Deaths and Ascending with Check , as i do for country column. Now you have separate OnNotify for both so there do not need of If condition  in By attribute of ListSort. You just simply put column name in By.


I think, Another way  to do , creating Entity for Rest API response  and use OutSystems scaffolding to generate your screens and have all sorting logic in place automatically.


Thanks and Regards,

Rahul


Hi Rahul,

I created sorting for both cases and country column but the sorting do not work. I created 2 OnNotify one for cases and another for country but the sorting for both still do not work. When i click on the column header, the sorting goes haywire. This happened for cases and country column. 

URL:   http://loo-chujun.outsystemscloud.com/cc/Entry1.aspx?_ts=637269047478511831


Regards,

Chu Jun


Solution

Loo Chu Jun wrote:

Rahul Kumar wrote:

Loo Chu Jun wrote:

Rahul Kumar wrote:

Hi, 

I have applied at column sort (asc or desc) on country and Deaths column in table record. You can check it now.



Thanks and Regards,

Rahul

Hi Rahul Kumar,

The sorting for the column deaths do not work.

Thank you.


Regards,

Chu Jun

Hi, 

I am sorry , it does not work for Deaths column . You can create another OnNotify for Deaths column where you need to ListSort By Deaths and Ascending with Check , as i do for country column. Now you have separate OnNotify for both so there do not need of If condition  in By attribute of ListSort. You just simply put column name in By.


I think, Another way  to do , creating Entity for Rest API response  and use OutSystems scaffolding to generate your screens and have all sorting logic in place automatically.


Thanks and Regards,

Rahul


Hi Rahul,

I created sorting for both cases and country column but the sorting do not work. I created 2 OnNotify one for cases and another for country but the sorting for both still do not work. When i click on the column header, the sorting goes haywire. This happened for cases and country column. 

URL:   http://loo-chujun.outsystemscloud.com/cc/Entry1.aspx?_ts=637269047478511831


Regards,

Chu Jun


Hi, 

It is working , 

check-

https://rano-rahul.outsystemscloud.com/cc/WebScreen1.aspx?_ts=637268965253913102


Thanks


Solution

Rahul Kumar wrote:

Loo Chu Jun wrote:

Rahul Kumar wrote:

Loo Chu Jun wrote:

Rahul Kumar wrote:

Hi, 

I have applied at column sort (asc or desc) on country and Deaths column in table record. You can check it now.



Thanks and Regards,

Rahul

Hi Rahul Kumar,

The sorting for the column deaths do not work.

Thank you.


Regards,

Chu Jun

Hi, 

I am sorry , it does not work for Deaths column . You can create another OnNotify for Deaths column where you need to ListSort By Deaths and Ascending with Check , as i do for country column. Now you have separate OnNotify for both so there do not need of If condition  in By attribute of ListSort. You just simply put column name in By.


I think, Another way  to do , creating Entity for Rest API response  and use OutSystems scaffolding to generate your screens and have all sorting logic in place automatically.


Thanks and Regards,

Rahul


Hi Rahul,

I created sorting for both cases and country column but the sorting do not work. I created 2 OnNotify one for cases and another for country but the sorting for both still do not work. When i click on the column header, the sorting goes haywire. This happened for cases and country column. 

URL:   http://loo-chujun.outsystemscloud.com/cc/Entry1.aspx?_ts=637269047478511831


Regards,

Chu Jun


Hi, 

It is working , 

check-

https://rano-rahul.outsystemscloud.com/cc/WebScreen1.aspx?_ts=637268965253913102


Thanks


Hi Rahul,

Do you have the oml file? Can you attach the oml file?

Thank you.


Regards,

Chu Jun


Loo Chu Jun wrote:

Rahul Kumar wrote:

Loo Chu Jun wrote:

Rahul Kumar wrote:

Loo Chu Jun wrote:

Rahul Kumar wrote:

Hi, 

I have applied at column sort (asc or desc) on country and Deaths column in table record. You can check it now.



Thanks and Regards,

Rahul

Hi Rahul Kumar,

The sorting for the column deaths do not work.

Thank you.


Regards,

Chu Jun

Hi, 

I am sorry , it does not work for Deaths column . You can create another OnNotify for Deaths column where you need to ListSort By Deaths and Ascending with Check , as i do for country column. Now you have separate OnNotify for both so there do not need of If condition  in By attribute of ListSort. You just simply put column name in By.


I think, Another way  to do , creating Entity for Rest API response  and use OutSystems scaffolding to generate your screens and have all sorting logic in place automatically.


Thanks and Regards,

Rahul


Hi Rahul,

I created sorting for both cases and country column but the sorting do not work. I created 2 OnNotify one for cases and another for country but the sorting for both still do not work. When i click on the column header, the sorting goes haywire. This happened for cases and country column. 

URL:   http://loo-chujun.outsystemscloud.com/cc/Entry1.aspx?_ts=637269047478511831


Regards,

Chu Jun


Hi, 

It is working , 

check-

https://rano-rahul.outsystemscloud.com/cc/WebScreen1.aspx?_ts=637268965253913102


Thanks


Hi Rahul,

Do you have the oml file? Can you attach the oml file?

Thank you.


Regards,

Chu Jun


I have already attached , name is  covid19data.oml  



Thanks


Hi Rahul,

I followed your oml and edited my own oml and the sortings are working now. Thank you for taking your time to help me.


Regards,

Chu Jun

Loo Chu Jun wrote:

Hi Rahul,

I followed your oml and edited my own oml and the sortings are working now. Thank you for taking your time to help me.


Regards,

Chu Jun

Hi, 

you r welcome,I am glad , i could be part of help. 

Thanks


Akshay Puri wrote:

Hi Loo Chu Jun,

You can do this using external data source as well, please see screenshots below:


Hi Akshay Puri,


May I know how do you create the Refresh GetUserById server action? How do you implement the refresh server action for rest api data?


Regards,

Chu Jun


Hi Loo Chu Jun

This can be created in Reactive web app . You are implementing Rest Api in Traditional that's why this is not available there. 

When we fetch data from external source then  we can refresh that source too in Reactive Web app.

For List Sorting column you can apply DataGrid  ( DataGrid Sample )too. 


Thanks