Trigger based on multiple fields
I have a proofer who may be called to work on several projects, and I want a single choice column that I can use to alert her that one of these projects need proofing.
I created a formula field PROOFING and inserted the following script:
if 'MAG STAGE' = "Ready to proof" or ('WEB STAGE' = "Ready to proof" or ('APP STAGE' = "Ready to proof" or 'BEV STAGE' = "Ready to proof")) then
'PROOF STAGE' = "Ready to proof"
else
null
end
It doesn't raise any alerts, but also it doesn't work! Help much appreciated ...
11 replies
-
To clarify: all the referenced fields are choice fields.
Also, the only other script I've got to work had to be placed in the Table Trigger After Update field.
-
Try to convert to text:
text('Mag Stage')
text('Web Stage')
etc
Nick
-
...or use Choice Id
Nick
-
Many thanks, Nick.
The following two formulae saved in the Trigger field in PROOFING produce "no" in PROOFING (when the value is selected in WEB STAGE) and nothing at all in the PROOFING STAGE field.
if text('MAG STAGE') = "Ready to proof" or (text('WEB STAGE') = "Ready to proof" or (text('APP STAGE') = "Ready to proof" or text('BEV STAGE') = "Ready to proof")) then
text('PROOF STAGE') = "Ready to proof"
else
null
endif 'MAG STAGE' = 3 or ('WEB STAGE' = 3 or ('APP STAGE' = 3 or 'BEV STAGE' = 3)) then
'PROOF STAGE' = 2
else
null
endHave I got the syntax wrong somewhere?
-
if 'Mag Stage' = 3 or 'Web Stage' = 3 or 'App Stage' = 3 or Bev Stage = 3 then
'Proof Stage' := 2
else
null
endWhy Proof Stage have to be Choice and not a Formula field?
Anyway the above code works for me.
Nick
-
if 'Mag Stage' = 3 or 'Web Stage' = 3 or 'App Stage' = 3 or 'Bev Stage' = 3 then
'Proof Stage' := 2
else
null
endNotice > :=
Nick
-
Hum ... it doesn't work on my laptop - or at least it stops me out with a "Formula may not modify data" warning. To answer your question, yes, PROOF STAGE could be a formula field. Sorry to be taking up your Sunday afternoon - and thans for you input!
-
I've created a small test file for you, download it and import to Ninox.
https://www.dropbox.com/s/qlzu0mbcfuqzddl/Proffing.ninox?dl=0
I hope it helps
Nick
-
Ah, brilliant! Thanks so much - that works great.
A couple of follow up questions (if you have time).
(1) If I want to do the same thing with a WRITING STAGE field, to alert writers that something's ready to do, how do I add that to the existing script in the table "Trigger after update" field? What goes after "end" to tell Ninox to trigger something else?
(2) How did you manage to put content in the left sidebar of your test file??
Thanks - this is really helpful.
-
1) You can continue adding code to the script, just separate them with a semicolon.
2) Click on column header and choose "Show Column...".
Nick
-
(1) Oh no, simple as that? Great!
(2) My mistake. I was in table trigger editing mode - Ninox lists the fields in the left sidebar. I just hadn't noticed it before. I meant the sidebar where Find and Calendar sit, but I guess that's not accessible.
Again, many thanks for your help, Nick.
Content aside
- 6 yrs agoLast active
- 11Replies
- 3971Views