Select to view content in your preferred language

Dynamic group background color

1062
2
07-11-2019 02:34 AM
Status: Open
hgaignard
Esri Contributor

Add a background color variable for groups. This variable could be dynamic, allowing you to change the background color of a group based on a response

For example, a survey on the compliance of building permits.
- If the group dedicated to the limits is in conformity then its background color becomes green
- If the group dedicated to buildings is non-compliant then its background color becomes red

Today, we can only use dynamic labels to get a quick overview of a group. The background color would improve the visibility of the answer

Tags (1)
2 Comments
AndyMcClary

It's been awhile since this got suggested but I haven't seen anyone address this so here goes:

You can accomplish this functionality using the backgroundColor property in the body::esri:style column of the group and a calculate field. First create a calculate field that handles the logic you need and returns the appropriate color value i.e. a field named background_calculated with the calculate field equal to:  if(${record_type}="valid", "blue","red"). Then set the backgroundColor property in the body::esri:style column of the group equal to that field: backgroundColor=${background_calculated}. That gives you a dynamic background for the whole group.

For whatever reason it doesn't seem to work if you put the logic directly in the body::esri:style column which is why you need a separate calculate field.       

João_CarlosPinto_Fernandes

Hello,

It's something interesting and very useful.
I share my file.

I wanted to add a file with my code, can't I?

Hugs