Display Rules referencing other fields values

I have a grid that displays a booking record, it displays the currency and the value and the transaction ID. What I want to do is highlight a cell that’s condition is based on the value of another field that is connected to this table, based on either being true or false.

For example: Mark this square green in the grid when checking the value of the cell against the connected table is the same. However in the Display logic there is only freeform text to use as a value. Is it possible to reference fields in other tables?

Cheers

Another way I wanted to ask other here.

If it would be possible to highlight fields in a row if two fields in the row were not the same. For example field 1 says GBP and field two says USD, that row becomes highlighted in red.

Cheers for any help.

Hi There

I do a similar function where I changet the background color of a field in the grid based on the status of the file.

In the appropriate field you will need to EDIT THE FIELD SETTINGS by clicking the pencil icon at the top of the column.

Then by using the display rules on the left of the screen you can set the conidtions under which a color for the field is to be used.

Note that there are multiple paramters that can be changed but you need to make sure you do them in the correct order depedning on what you want to do with results.

For example if you want to hide the value of the field and change the background colour you must chence the colour before hiding the value (see image)

NOTE I deliberately did the change in the reverse to show how putting these display parameters in the wrong order resulted in the field background NOT reflecting colour).

Hope that makes sense.

SO FOR YOUR EXAMPLE WHERE VALUE OF 1 FIELD COMPARED TO VALUE IN A SECOND FIELD

As there is not really any conditional formulas within KNACK you can achieve what you want by using the above method as a workaround, but you would need to set the diplsay rules for each of the field if you want the entire line illuminated.
As we are talking about “text field values” (i.e USD AUD GBP etc) and multiple columns, you would need to set a numeric value to each of the text values in a separate field.

In my example I set a Value for each of the appropriate text fields, in this case giving value of 1 to SERVICE if its 'ARMY" and then value of 1 if the Country is “Australia”, 0 if its Czechoslovakia etc etc

Then an equation field is a multiplication of the 2 value in the RESULT field

When going back to your grid screen, use the display value settings to work out what your want to do with the field/line. In this example if the value is “RESULT” is greater than “0” then I display the background color as green , hide the value and display an icon “TICK” . If its less than “1” then I display a different background colour and an “X”.

You can of course leave the value fields off the display but just showing you a grid display with coloured results of the ruslt field and the value corrsponding.

Toi take it further towards your goal, I used the same display settings on the other relevant fields

NOTE THOUGH THAT IF A RECORD DOES NOT HAVE VALUES ENTERED IT WILL DEFAULT TO BELIEVEING THAT THE VALUES ARE 0 IF THE FIELD IS BLANK

AND WITH THE VALUES NOT DISPLAYED IN THE GRID THE RESULT IS AS SHOWN

In my opinion of you use a white background for the grid as is standard, and choosing appropriate colors, the row pretty much stand out without the need to “color the entire line” in the grid"

Hi @RayWindlow47079, thanks for this it’s really helpful to see how you’ve essentially created an equation on the table side that essentially will plug the non-ability to do an evaluation within the display rule. I should be able to work out how to do that now.

1 Like

I’ve now been able to look over this and what I can’t see:

If you have Table X (that is shown in the grid display) and you want to set the value of a field in Table X, based on the value of a field in Table Y, I can’t see how that is achieved here.

I have a connection between Table X and Table Y, where the field I need to compare has been set in Table Y. This is not the field

However, I can’t see how to pull that into an equation or text formula so it gives me an output then can then be used in the display filter. This is not the main Display Field in Table Y but one of the fields inside this table.

Right finally worked out how to do this!

This can be achieved by (I’ve referenced the bullet numbers in the solution)

a) Setting a text formula that is simply the value from the connected table you want to use. (called A)
b) Setting another text formula that is simply the value from the current table you want to match. (called B)
c) A short text field that is going to contain a result you can then operate on.

The Short Text field has no value, it will be populated based on the conditional formatting and in evaluating

Those conditions will be two.

Rule #1 When a) is Field value b) then set to a custom value 1
Rule #2 When a) is not Field value b) then set to a custom value 2

You now have a dynamic reference handle for the front end.

On the front end you then use a display rule that happens on a field level that basically says.

If c) contains “2” set background colour to #CCCCCC

Repeat the rule each field in a row or just the highlighted cell.

Does the trick.

1 Like