FileMaker Pro TextColor as a calculation for a field in a table - field

I have a list of colors that we use and I am creating an app where I am storing the RGB values of those colors in 3 fields R, G & B. Then I have another text field in which I used this ██████ Unicode block of text and used a script to SET FIELD and then calculated the TEXT COLOR of this field to display the correct color as per RGB values by using script trigger whenever the RGB values are modified. Everything works well.
Now what I want to do it display all the color names and the correct color in a portal. The problem is all the RGB values are taken from the current record and so my portal shows different color names but the Unicode block of text is always in the same color. Any ideas on how can I correctly incorporate this? I tried Googling and even skimmed through the documentation of FileMaker but could not figure out a workaround.
Thanks!

It is difficult to understand your structure. If you have "a list of colors" then you should have a table of Colors, with fields for R, G, B and a calculation field for displaying the swatch - all in the same table.
A portal to such table will show one row per record - and each row will show the fields from the corresponding record, including the swatch field.
There should be no need to use any scripts or script triggers for this.

Related

Conditional formatting based on a range of names

I'm trying to make conditional formatting that changes the color of a cell (Red, Blue, Green) based on a range of names on a different sheet. What I have is three lists of names that are either Red, Blue or Green. When I make a list with these names on a separate sheet I want the formatting to change their color to the ones assigned.
The formatting I want to make is something along the lines of "IF the value (name) in this cell is the same as the value (name) in any of cell in a range on another sheet it should change the color automatically.
Here is a link to a sheet where I tried to set it up they way I wanted it to look but I still can't get the formatting to work
https://docs.google.com/spreadsheets/d/1i1DM8X6gyRNMUmYBAtuupeuCUA1iB4LhMDwkD7PHi8w/edit?usp=share_link
I was trying the conditional formatting tool with formulas but I kept getting errors with the formulasenter image description here The picture is in Swedish because google sheets would keep defaulting back to it regardless how much I tried.
One thing is that Conditional Formatting doesn't allow you to directly refer to another sheet. You can do work it around via INDIRECT.
And to compare to several texts, you should not choose the option text contains, but you can find useful REGEXMATCH and TEXTJOIN:
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!A2:A11")))
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!B2:B11")))
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!C2:C11")))

Is it possible to do Alternating Color Formatting with same color for repeated rows [duplicate]

So I have a spread sheet that has a bunch of data in it... The first column is the state, second is a name. What I want to do is have the rows alternate blue/red/blue/red (to make it easy to read) but I don't want it to alternate EVERY row like evens/odds. What I want is for each state to have a different color. So all the rows with AL blue, then CA red, CT blue, etc... This is just a basic example. Obviously here I could just hardcode the 50 states, but is there any way to automate this process so that basically every time the state changes, I switch colors?
State Name
AL John
CA Bill
CA Joe
CA Chad
CT Mary
VA Beth
VA Dani
In Google Sheets you can count how many unique names there are down to the current cell and test if it's an odd number
=isodd(countunique(A$2:A2))
Apply this to the range as a custom formula in conditional formats with the first fill colour.
Then apply
=iseven(countunique(A$2:A2))
as another rule with the second fill colour.
In Excel it's more difficult to do this, would end up with something like
=ISODD(SUM(--(FREQUENCY(MATCH(A$2:A2,A$2:A2,0),MATCH(A$2:A2,A$2:A2,0))>0)))
and
=ISEVEN(SUM(--(FREQUENCY(MATCH(A$2:A2,A$2:A2,0),MATCH(A$2:A2,A$2:A2,0))>0)))
Note this only works if the data is sorted by state as in your test data.
You can use Format as a table with the following procedure:
Open the worksheet.
Select the cell range that you want to shade, or
press Ctrl+A to select the whole worksheet.
Click the Home tab.
In the Styles group, click Format as Table, and then click the style of
formatting that you want.
In the Format as Table dialog box, click OK.
Also, as an alternative you can use Conditional Formatting.

RowStyle Dynamically

I am working on the jsPDF library in one of my projects, where I have a colors array coming from the database for each row there is a color, so I want to assign that individual color to a respective row, by using "willDrawCell" and assigning doc.setFillColor(COLOR_CODE), by doing so I am only able to assign a single color to all rows, but actually I want to assign each row different color depends upon the array of colors coming from database.

Google Sheets: How Do I Colour A Cell In 2 Cases Context Based on Values From Another Sheet

I'm trying to create a heads up display on the number of Hints a user has collected in a contest.
There are different categories of hints here.
So I'm trying to create a process such that in the respective Hints tab (ie Bonus Hint in this case)
Filling in Column B (with the hint description), renders that Hint as being "obtained" and hence showing up "Green" in my Hints Overview sheet.
However, for "unobtained" hints, by not filling in Column B, I want my Hints Overview to instead still show the Hint number but in light gray (as illustrated below)
I dont want the unobtained hints to be empty cells. I want to make them looked grayed out. ^^^
I tried pulling some conditional formatting tricks like indirect(), ISBLANK() but something about CF just doesn't allow me to get what I desire.
And the other challenge is that because I arranged my headsup-display to be grid-like, the cell filling has to take on horizontal filling. Its not like as I can simply drag and fill 250 rows vertically.
How can I pull these things off in Google Sheets? (trust you guys to please dont maliciously edit my sheet out of mischief)
https://docs.google.com/spreadsheets/d/1IG6l0xkJSU-mxP6YVr73RwinEcdxSePI4HN02KF-WoA/edit?usp=sharing
delete everything in DASHBOARD!D8:AB17
use this in D8:
=SEQUENCE(10, 25)
remove your green CF rule and set the font to gray
now add this new CF rule as custom formula:
=INDEX(VLOOKUP(D8, {ROW(INDIRECT("BONUS!B2:B"))-1, INDIRECT("BONUS!B2:B")}, 2, 0))<>""
and set background to your green and font to white
also change DASHBOARD!AD17 to:
=COUNTA(BONUS!B2:B251)

Conditional format alternate between 2 colours for groups of rows based on value change

I have a spreadsheet that is in Google Sheets which has a column that I want to format conditionally. I want to format it, such that groups of rows which all hold the same value are dark grey, while they next group of rows of all the same value are light grey. For example, I want the sheet to look something like this:
The numbers will not neccesarily be grouped in order, so I can't just use =mod(a1,2)=1 for the conditional format. I also would like it to update so that no matter how the other columns are filtered, this column remains such that every time the value in the next row is different, it and its duplicates are all a new color, mainly for visualization, to see which data is grouped together.
If I'm to use the formulae =isodd(countunique(a$2:a2)) and =isodd(countunique(a$2:a2)) and then apply some filter, then I get the following, which doesn't alternate the colors based on what is shown.
Any help would be great. Thanks.
Try
=isodd(countunique(a$1:a1))
for the light grey and
=iseven(countunique(a$1:a1))
for the dark grey
EDIT
The same question was asked in Excel recently and I realised it would be better just to count the changes of value like this:
=ISEVEN(SUMPRODUCT(--(A$1:A1<>A$2:A2)))
This does highlight correctly if a duplicate appears in more than one continuous sequence:
whereas the original formula would have highlighted incorrectly:
It doesn't solve the filtering question though.

Resources