Skip to main content
Participant
February 26, 2024
Question

Cell dropdown in relation to another cell

  • February 26, 2024
  • 1 reply
  • 1153 views

This is a 2 part question:

1. I have 2 drop downs next to each other, "In" and "Out". If one of them is selected, I need the other one not to work and vice versa. How do you accomplish this?

2. The 2 drop downs in question above, "In" and "Out", if it is "In" I need another cell to be black positive number. If the "out" is selected, I need the cell to be a red negitive number. How do you accomplish this?

 

Thanks for anyones help.......

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
February 26, 2024

1. You can set the field to read only depending on condition, with a script, to help you further would need to know dropdown choices and which condition is to set them to read-only.

2. In text field properties under 'Format' tab, format it as number and there is also an option to show negative number in red.

Participant
February 27, 2024

Thanks for the reply.

1. The only thing to select in the 2 drop downs is a "X" or a "blank". If one drop down is selected, I need the other not to work. So it is wither or. The "In" drop down needs to result in a positive numbe and the "Out" needs to result in a negitive number in red. Both of these drop downs need to talk to the "Weight" column. (See attached)

2. I tried formating it as a number, but it wont let me because it is a letter. Should I maybe change it to a check box?

Thanks for all of your help.

Nesa Nurani
Community Expert
Community Expert
February 27, 2024

You want to show "Weight" field in red?

Let's say dropdown fields are named "In1" and "Out1", you can use this as custom calculation script of "Weight" field:

var dIn = this.getField("In1");
var dOut = this.getField("Out1");

dOut.readonly = (dIn.valueAsString === "X") ? true : false;
dIn.readonly = (dOut.valueAsString === "X") ? true : false;

event.target.textColor = (dOut.valueAsString === "X") ? color.red : color.black;