[{"data":1,"prerenderedAt":437},["ShallowReactive",2],{"guide:en:automations\u002Frules":3},{"id":4,"title":5,"body":6,"description":429,"extension":430,"meta":431,"navigation":432,"path":433,"seo":434,"stem":435,"__hash__":436},"guide_en\u002Fguides\u002Fen\u002Fuser\u002Fautomations\u002Frules.md","Rules",{"type":7,"value":8,"toc":414},"minimark",[9,13,30,35,46,68,75,79,98,102,137,140,155,158,188,191,197,267,270,274,296,320,327,331,341,345,358,361,365],[10,11,5],"h1",{"id":12},"rules",[14,15,16,17,21,22,25,26,29],"p",{},"A rule acts by itself when something happens. It reads as one sentence: ",[18,19,20],"strong",{},"When"," a work order's status changes, ",[18,23,24],{},"if"," its priority is high, ",[18,27,28],{},"then"," send a notification.",[31,32,34],"h2",{"id":33},"starting-a-rule","Starting a rule",[14,36,37,38,41,42,45],{},"On a category or a connection, open ",[18,39,40],{},"⋯ › New rule here",". ",[18,43,44],{},"What should happen automatically?"," offers that category's recipes, such as:",[47,48,49,53,56,59,62,65],"ul",{},[50,51,52],"li",{},"notify someone when a work order is completed;",[50,54,55],{},"open an incident on the nearest watermain when a resident reports a break;",[50,57,58],{},"email a team when a report is submitted;",[50,60,61],{},"create a recurring maintenance work order;",[50,63,64],{},"start a response timer when a work order is created;",[50,66,67],{},"create a work order from an inspection form.",[14,69,70,71,74],{},"Pick one to start from it, or ",[18,72,73],{},"Start from scratch",". Either way, everything stays editable before you save.",[31,76,78],{"id":77},"the-sentence","The sentence",[14,80,81,82,85,86,89,90,93,94,97],{},"The rule's window shows its ",[18,83,84],{},"Name",", whether it is ",[18,87,88],{},"On",", its ",[18,91,92],{},"Priority"," and its sentence. Press a part of the sentence, or the ",[18,95,96],{},"⋯"," beside it, to edit that part.",[99,100,20],"h3",{"id":101},"when",[47,103,104,110,116],{},[50,105,106,109],{},[18,107,108],{},"Happens when",": the event that starts the rule. Events come from every area: a record created, changed, completed or reassigned, a status change, a report validated, stock running low, a payment received, a reading arriving from a sensor, an alarm raised, a timer running out, a file uploaded, a version committed, a person invited, or a schedule coming round.",[50,111,112,115],{},[18,113,114],{},"Applies to",": the kind of record, for events that apply to several.",[50,117,118,121,122,125,126,125,129,132,133,136],{},[18,119,120],{},"Repeats",": ",[18,123,124],{},"Every time",", ",[18,127,128],{},"Once per record",[18,130,131],{},"Once until it clears",", or ",[18,134,135],{},"At most once per"," a number of minutes.",[14,138,139],{},"A schedule runs daily, weekly, monthly or on a custom pattern: a day of the month, or a weekday such as the first Monday, at a time you set. A scheduled rule can run once for each record of a kind.",[14,141,142,143,146,147,150,151,154],{},"A threshold watches a number or a date on your assets and fires when it is crossed: ",[18,144,145],{},"Once, when it passes"," a value, or ",[18,148,149],{},"Every time it advances by"," an amount, with ",[18,152,153],{},"Days before"," to fire early on a date.",[99,156,157],{"id":24},"If",[14,159,160,163,164,167,168,171,172,175,176,179,180,183,184,187],{},[18,161,162],{},"Condition"," adds a check on the record or the event: a ",[18,165,166],{},"Field",", a ",[18,169,170],{},"Comparison"," and a ",[18,173,174],{},"Value",". Comparisons read as words: is, is not, is more than, is at least, is any of, is none of, contains, matches. From the second condition on, ",[18,177,178],{},"Joins with"," joins it to the one before with ",[18,181,182],{},"and"," or ",[18,185,186],{},"or",".",[99,189,190],{"id":28},"Then",[14,192,193,196],{},[18,194,195],{},"Action"," adds what the rule does. Actions come in groups:",[47,198,199,214,228,242,259],{},[50,200,201,121,204,125,207,125,210,213],{},[18,202,203],{},"Communication",[18,205,206],{},"Send email",[18,208,209],{},"Send notification",[18,211,212],{},"Raise a help request",";",[50,215,216,121,219,125,222,125,225,213],{},[18,217,218],{},"Create record",[18,220,221],{},"Create work order",[18,223,224],{},"Create incident",[18,226,227],{},"Create assignment",[50,229,230,121,233,125,236,125,239,213],{},[18,231,232],{},"Update data",[18,234,235],{},"Update field",[18,237,238],{},"Run calculation",[18,240,241],{},"Log a reading",[50,243,244,121,247,125,250,125,253,125,256,213],{},[18,245,246],{},"Integration",[18,248,249],{},"Call webhook",[18,251,252],{},"Write to Postgres",[18,254,255],{},"Write to SQL Server",[18,257,258],{},"Deliver artifact",[50,260,261,121,264,187],{},[18,262,263],{},"Timer",[18,265,266],{},"Start SLA timer",[14,268,269],{},"Each area adds its own actions, such as issuing a charge or sending an order to its supplier.",[31,271,273],{"id":272},"changes-that-wait-for-approval","Changes that wait for approval",[14,275,276,277,280,281,284,285,288,289,41,292,295],{},"A rule can check a change before it lands. Pick the ",[18,278,279],{},"Record type",", the ",[18,282,283],{},"Field it watches",", and optionally the values ",[18,286,287],{},"From"," and ",[18,290,291],{},"To",[18,293,294],{},"Before it lands"," sets what the change needs:",[47,297,298,310],{},[50,299,300,303,304,183,307,213],{},[18,301,302],{},"Someone approves it",": the change waits for one of the ",[18,305,306],{},"People who approve",[18,308,309],{},"Roles that approve",[50,311,312,315,316,319],{},[18,313,314],{},"A form is filled",": the change is refused until the record carries the ",[18,317,318],{},"Form"," you name.",[14,321,322,323,326],{},"The rest of the save lands. An approver sees the waiting change under ",[18,324,325],{},"Approvals"," in the bell and decides it there.",[31,328,330],{"id":329},"testing-a-rule","Testing a rule",[14,332,333,336,337,340],{},[18,334,335],{},"Run test"," fires the rule's actions with sample data. Calls to other systems run for real and show in ",[18,338,339],{},"Activity"," marked as a test. Emails are checked and not sent. Actions that would change records are skipped.",[31,342,344],{"id":343},"history","History",[14,346,347,348,350,351,353,354,357],{},"A rule's ",[18,349,96],{}," holds ",[18,352,344],{},", every run of the rule, and ",[18,355,356],{},"Changes",", every edit to it. Its window shows the runs and errors so far.",[14,359,360],{},"A record that a rule created says so at the top of its form, with a link to the rule.",[31,362,364],{"id":363},"rules-on-other-pages","Rules on other pages",[14,366,367,125,370,125,373,125,376,288,379,382,383,385,386,389,390,288,393,41,396,399,400,125,403,183,406,409,410,413],{},[18,368,369],{},"Map",[18,371,372],{},"Assets and inventory",[18,374,375],{},"Charges",[18,377,378],{},"Permits",[18,380,381],{},"Service portal"," each hold a ",[18,384,5],{}," window in their ",[18,387,388],{},"⋯ More",". It lists the rules that touch that area, in two groups: ",[18,391,392],{},"Listens to this",[18,394,395],{},"Acts on this",[18,397,398],{},"Filters"," narrows by ",[18,401,402],{},"On or off",[18,404,405],{},"Included",[18,407,408],{},"Written here",", and ",[18,411,412],{},"With errors",". These are the same rules as on the Automations page.",{"title":415,"searchDepth":416,"depth":416,"links":417},"",2,[418,419,425,426,427,428],{"id":33,"depth":416,"text":34},{"id":77,"depth":416,"text":78,"children":420},[421,423,424],{"id":101,"depth":422,"text":20},3,{"id":24,"depth":422,"text":157},{"id":28,"depth":422,"text":190},{"id":272,"depth":416,"text":273},{"id":329,"depth":416,"text":330},{"id":343,"depth":416,"text":344},{"id":363,"depth":416,"text":364},"Writing a rule as a sentence: when it runs, the conditions it checks and what it does; schedules, thresholds, changes that need approval, testing a rule and reading its history.","md",{},true,"\u002Fguides\u002Fen\u002Fuser\u002Fautomations\u002Frules",{"title":5,"description":429},"guides\u002Fen\u002Fuser\u002Fautomations\u002Frules","VjImt8m0ElbItMbMigNeeOV1HFCpzTmTtERTZN6oZEM",1793063526789]