Determine Multiple Choice baed on other field
Hi would like to set the value of a multiple-choice based on the value of another field, I have tried:
if EU = 1 then
EVG Sales Regions =: classification("Europe").
My problem is further if there are multiple selections such as USA = 1 and China - 1 how do I set each field to select on multiple choice?
See attached input fields
Thanks
5 replies
-
You can use something like this...
'EVG Sales Regions' := unique(numbers('EVG Sales Regions'), 1)
for Europe
'EVG Sales Regions' := unique(numbers('EVG Sales Regions'), 2)
for UK, etc
You could implement a it couple of different ways. I would enter it in "Trigger after update" for each of the Number fields like...
if EU = 1 then
'EVG Sales Regions' := unique(numbers('EVG Sales Regions'), 1)
End
-
"End" should be "end"
-
Thanks Sean, the formula works. My challenge lies with existing data since Ninox triggers don't execute for existing data unless I go back and change each field by hand
-
wynand, You can attach this code to a button and it will update existing records...
for r in select YourTable do
if r.EU = 1 then
r.('EVG Sales Regions' := unique(numbers(r.'EVG Sales Regions'), 1))
end;
if r.UK = 1 then
r.('EVG Sales Regions' := unique(numbers(r.'EVG Sales Regions'), 2))
end;
if r.US = 1 then
r.('EVG Sales Regions' := unique(numbers(r.'EVG Sales Regions'), 3))
end;
if r.China = 1 then
r.('EVG Sales Regions' := unique(numbers(r.'EVG Sales Regions'), 4))
end
end
-
Works perfectly thanks
Content aside
- 5 yrs agoLast active
- 5Replies
- 1493Views