Skip to main content
Participating Frequently
December 22, 2023
Answered

Change field value based on border color

  • December 22, 2023
  • 1 reply
  • 1662 views

Hello,

 

I am working on a document for my company. There are some options that I want to directly correlate to another sheet. See attached screenshots.

 

The ideal scenario is:

If the user select "Cleaning System" on sheet 1, the border color will change to red. Once the border changes to red, the field value on sheet 3 will read "Yes". If the user deselects "Cleaning System" on sheet 1, the field value on the sheet 3 will read "N/A". I've done this before with check boxes, but not sure what the export values are for buttons. Any help is appreciated. Thank you!

This topic has been closed for replies.
Correct answer Nesa Nurani

Use this:

this.getField("Cleaning System Eng").value = (color.equal(color.red, event.target.strokeColor)) ? "Yes" : "N/A";

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
December 22, 2023

Use this:

this.getField("Cleaning System Eng").value = (color.equal(color.red, event.target.strokeColor)) ? "Yes" : "N/A";

try67
Community Expert
Community Expert
December 22, 2023

Just be aware the at the equal method is very finicky. It works well with the base colors, but as soon as you introduce fractions as the values of the color elements, it's likely to stop working correctly.