How to get data from selected row
Application Type
Reactive
Service Studio Version
11.10.2 (Build 36659)

Hi all, 

I had generated a list of records (rows) on a screen, where the data came from an aggregate. 

When I tried to click/select any row (from the list) , I can only get the data from one specific row (e.g. if I have 5 rows of data, I clicked the 4th row but getting the data from 1st row, not the 4th). 

How can I get the data from the row that I clicked? 

Appreciate the advice from all. 

mvp_badge
MVP
Solution

Hi Jaina,

For the mentioned case, you can try the below solutions:

Solution: 1) Pass the mapped Aggregate Output List CurrentRowNumber runtime property value as input parameter to the OnClick client action and access the required attribute value as shown below

Aggregate.List[CurrentRowNumber].EntityName.AttributeName

Solution: 2) Pass the mapped Aggregate Output List CurrentRecord value as input parameter to the OnClick client action, in order to get the current record attributes value

Solution: 3) Pass the current List record, Identifier Attribute value to the OnClick client action as input parameter, then filter the Aggregate List within the client action flow using the ListFilter action based on the input identifier value.

Solution: 4) You can also access the current record of the mapped Aggregate within the OnClick client action as shown below.

Aggregate.List.Current.EntityName.AttributeName


Hope this helps you!


Kind regards,

Benjith Sam

Hi Benjith, thanks a lot for your response. I'll try the solutions provided and update here. 

Hi Benjith, I'm happy to let u and others know that Solution 3 solved my problem. I believe other solutions can be used as well, but I found Solution 3 is easier to apply in my case. Thanks a lot. 

mvp_badge
MVP

You're most welcome, Jaina :)

Glad to help you :)


Kind regards,

Benjith Sam

I use a TableRecord. I want to get the selected row.For example, I want to delete the selected row. But when I use CurrentRowNumber , it always return the last row. How can I get the selected row?
mvp_badge
MVP

Hi Chen Jing,

If you have a Traditional Web App, be sure to use the Table Records widget's Current instead of the Current of the list that's bound to the Table Records.

Hi,Kilian Hekhuis

Thank for your reply.

My app is a Traditional web app.

But I just find the Table.List.Current in the Scope.How to use the Table Recores widget's Current?




mvp_badge
MVP

Hi Checn Jing,

That's indeed the right one. That's the Current that will hold the record if you click inside the AcmApplicationClusterTypeTable Table Records widget on a row (and trigger a Screen Action).

Thank you very much!

1. How to trigger a screen action by a table records widget on a row. In my opinion,the onclick property on a row should trigger a screen action, like this:

 Is that right?

2.The Current property on the Table Records should be the selected row. But it works on the Link, like this:

it can open the detail screen for the selected row ,but it not work when use in the Property. when use in the property, the current is always be the last row of the record. So I want to know the right way to use the current for the selected row

mvp_badge
MVP

Hi Chen Jing,

What you would typically do in an OutSystems application, is to have Buttons (or Links) inside the Table Records, inside a column. So the delete button would usually go in a column at the end of the row (together with an edit button, etc.). If you click that Button or Link, the Screen Action that is called will have the Current set to the row you clicked.

Also, you should not use onclick. It doesn't work nice with the OutSystems way of doing things.

Thank you !

It seems like ,Current can use like this. Button on the row .

Another question,How to implement batch delete in table record widget? Use check box in row?

Hi Jaina ,

Can you please share your oml?

Thanks,

Samiksha

I think there is problem with Id your are passing .

Hi Samiksha, thanks for your reply, but unfortunately, I will not be able to share the oml as I might share some sensitive information, but I can share some screenshots whichever required for you to help. 

mvp_badge
MVP

Hi Jaina,

What do you mean by "click/select" and "get the data"? You'll need to be a lot more specific about what you have created for us to be able to help you. Sharing the module like Samiksha suggested would help a lot.

Hi Kilian, sorry for the confusion. I'd extracted some data from an aggregate to the screen as few rows of data. What I'm trying to do next is to select one of the rows, grab the value from every columns of the selected row and use it in an action. 

mvp_badge
MVP
Solution

Hi Jaina,

For the mentioned case, you can try the below solutions:

Solution: 1) Pass the mapped Aggregate Output List CurrentRowNumber runtime property value as input parameter to the OnClick client action and access the required attribute value as shown below

Aggregate.List[CurrentRowNumber].EntityName.AttributeName

Solution: 2) Pass the mapped Aggregate Output List CurrentRecord value as input parameter to the OnClick client action, in order to get the current record attributes value

Solution: 3) Pass the current List record, Identifier Attribute value to the OnClick client action as input parameter, then filter the Aggregate List within the client action flow using the ListFilter action based on the input identifier value.

Solution: 4) You can also access the current record of the mapped Aggregate within the OnClick client action as shown below.

Aggregate.List.Current.EntityName.AttributeName


Hope this helps you!


Kind regards,

Benjith Sam

Hi Benjith, thanks a lot for your response. I'll try the solutions provided and update here. 

Hi Benjith, I'm happy to let u and others know that Solution 3 solved my problem. I believe other solutions can be used as well, but I found Solution 3 is easier to apply in my case. Thanks a lot. 

mvp_badge
MVP

You're most welcome, Jaina :)

Glad to help you :)


Kind regards,

Benjith Sam

I use a TableRecord. I want to get the selected row.For example, I want to delete the selected row. But when I use CurrentRowNumber , it always return the last row. How can I get the selected row?
mvp_badge
MVP

Hi Chen Jing,

If you have a Traditional Web App, be sure to use the Table Records widget's Current instead of the Current of the list that's bound to the Table Records.

Hi,Kilian Hekhuis

Thank for your reply.

My app is a Traditional web app.

But I just find the Table.List.Current in the Scope.How to use the Table Recores widget's Current?




mvp_badge
MVP

Hi Checn Jing,

That's indeed the right one. That's the Current that will hold the record if you click inside the AcmApplicationClusterTypeTable Table Records widget on a row (and trigger a Screen Action).

Thank you very much!

1. How to trigger a screen action by a table records widget on a row. In my opinion,the onclick property on a row should trigger a screen action, like this:

 Is that right?

2.The Current property on the Table Records should be the selected row. But it works on the Link, like this:

it can open the detail screen for the selected row ,but it not work when use in the Property. when use in the property, the current is always be the last row of the record. So I want to know the right way to use the current for the selected row

mvp_badge
MVP

Hi Chen Jing,

What you would typically do in an OutSystems application, is to have Buttons (or Links) inside the Table Records, inside a column. So the delete button would usually go in a column at the end of the row (together with an edit button, etc.). If you click that Button or Link, the Screen Action that is called will have the Current set to the row you clicked.

Also, you should not use onclick. It doesn't work nice with the OutSystems way of doing things.

Thank you !

It seems like ,Current can use like this. Button on the row .

Another question,How to implement batch delete in table record widget? Use check box in row?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.