Replies: 7 comments 6 replies
-
Hi Jon, Don't think this is possible with cfv alone as you can't have 2 conditions in one cfv. You could try using 2 new fields in your object:
This should work, see info here about the ternary equations https://learn.knack.com/article/how-to-guides#logic-equations-formulas (it's right the bottom). I'm just having a go at it myself for something I've wanted to try. Let my know how you get on. Amanda |
Beta Was this translation helpful? Give feedback.
-
Using keyword _cfv or another KTL keyword, is it possible to change the color of an icon based on the value of another "connected" field's value found in the same grid. Example: if field 100 value is "NO" then edit icon is green, if field 100 value is "YES" than edit icon is red. This is easy to accomplish using Knack's display rules but Knack doesn't allow you to reference "connected" fields in the rules. Any and all help is appreciated... JON |
Beta Was this translation helpful? Give feedback.
-
Hi Jon, What you could do is add a text formula field which pulls your connected YES/NO field into the object your grid is based on and then reference that field in the display rule. Amanda |
Beta Was this translation helpful? Give feedback.
-
Hi Jon, I completely agree, would make life easier, instead of having to find workarounds. In theory _cfv could work . . . _cfv=[Frequency, is, Weekly, green, , ,], [ktlTarget, Edit Status] Though when I tried it in a similar situation all the icons were green whether or not they were weekly. In my example Frequency is the connected value and Edit Status is the column with the icon, on further inspection the cfv does work to a point, in that color: green is added to the td, but Knacks styling of the .kn-table-link takes over, as their style is applied further down the dom. Amanda |
Beta Was this translation helpful? Give feedback.
-
I'm trying to change the font color of "field 2" in a grid to green if it's currency value is less than "field 1's" using the below: _cfv=[field_2,lt,ktlRefVal,green,], [ktlRefVal, field_1] Both fields are located on the same table/view. I have tried changing the field id's to the actual name of the field in the table and the field's name on the table. I also tried adding the views name after "field_1" (ie ktlRefVal, field_1, XYZ) with no luck Both field 1 and field 2 are equation fields that are the total added values of certain "currency" fields. Any and all help would be appreciated... JON |
Beta Was this translation helpful? Give feedback.
-
Hey Craig, thank you for the reply and my apologizes I didn't see her post. It was driving me crazy trying to figure out what I was doing wrong. Hope Norm has a solution. |
Beta Was this translation helpful? Give feedback.
-
Craig, unless I missed something in Amanda post, it works for me. Here is what I did: _cfv=[field_541,gt,ktlRefVal,#f70707,,], [ktlRefVal, field_540,] field 540 = "99" field 541 turns red, field 540 = "101" field 541 changes to green. If they both equal "100" there both black. I just can't get it to work for me if the fields have a currency values in them. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently using the keyword _cfv to change the font color/weight based on a field's value and it works as expected
cfv=[Status, has, SUBMITTED, #FA2307,,625,p]
But now what I want to accomplish is the following:
if Status has "SUBMITTED" and field 100 is "1234" font color is "FA2307" weight 625, p (field 100 is on the same table/view)
if Status has "SUBMITTED" and field 100 is "2468" font color is "000000" weight 625, p (field 100 is on the same table/view)
Any and all help would be appreciated... JON
Beta Was this translation helpful? Give feedback.
All reactions