390
Views
7
Comments
Solved
How to show icons based on a condition in the row in outsystems datagrid
Question
Application Type
Reactive

I want to show the two different icons in one column based on the value in the current row in outsystems datagrid. If anyone know the solution please help me.

2023-03-08 10-32-19
Vinod Kumar R
Solution

Hello @Suriyakala S,

You have to add a class in the variable and call the column in grid

Fallow the below steps to show icon based on condition 


1) create a structure with required columns as mentioned

2) Bound the aggregate output to your variable list (structure)

Note: while binding based on condition change the icon names as per need

3) Then call the ArrangeData with the same variable (structure) list

4) Get the JSON output with required column and bound to Grid source

5) Add the columns to Grid manually and bind the headers

Output

Attached is the OML for your reference 

Regards,

Vinod

Grid.oml
2025-03-05 10-16-14
Suriyakala S

@Vinod Kumar R , I think this will work for me. Thanks for the reply.

2025-03-05 10-16-14
Suriyakala S

Hi @Vinod Kumar R , I have another requirement in datagrid. That is i need to show the color for text in all columns for the particular row based on condition. do u have any solution for this?

2025-10-10 00-19-44
Bruno Rendeiro

Hello @Suriyakala S 

You just need to add an if whit your condition, like this


Then when the condition is true you put the icon you want if is false you put the other icon, and on the if condition you put your condition, based on the current context

2025-03-05 10-16-14
Suriyakala S

@Bruno Rendeiro , Im not using table records, im using Datagrid. But thanks for your reply.

2023-03-08 10-32-19
Vinod Kumar R
Solution

Hello @Suriyakala S,

You have to add a class in the variable and call the column in grid

Fallow the below steps to show icon based on condition 


1) create a structure with required columns as mentioned

2) Bound the aggregate output to your variable list (structure)

Note: while binding based on condition change the icon names as per need

3) Then call the ArrangeData with the same variable (structure) list

4) Get the JSON output with required column and bound to Grid source

5) Add the columns to Grid manually and bind the headers

Output

Attached is the OML for your reference 

Regards,

Vinod

Grid.oml
2025-03-05 10-16-14
Suriyakala S

@Vinod Kumar R , I think this will work for me. Thanks for the reply.

2025-03-05 10-16-14
Suriyakala S

Hi @Vinod Kumar R , I have another requirement in datagrid. That is i need to show the color for text in all columns for the particular row based on condition. do u have any solution for this?

2024-09-12 02-43-38
Deepsagar Dubey

Hi @Suriyakala S 

As i understood either you are using ArrangeData  server action or JSONSerialise tool as the Data property,

Data (Text): MandatoryThe data displayed in the Grid.

So if you are fetching data from aggregate and later you convert this data to JSON, then before converting it to JSON you can add one more which you want to display in your Grid,

preferred way to add a computed column in Aggregate itself and from there you can use it in your grid.

I hope it'll help you,

Thnaks

Deep

 

2025-03-05 10-16-14
Suriyakala S

@Deepsagar Dubey , Im using arrangedata server action. Okay. I will try what u said. Thanks for the reply.

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