Help creating table rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 10:42 AM
I want to create some fields in a table but I can't understand its rule with certain date fields, example: I created a table and incorporated the Task table, which already comes with the State, Opened and Closed fields and these fields already have a rule between them, if the state is open, the Opened field marks the date and time when it was made, same thing in Closed when the state is closed.
But how do I make this rule from scratch? If I create a table from scratch it will only have the standard fields, how would I put this rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 12:38 AM
Hi @Arthur Sanchez , response from @Astik Thombare must answer your question. If not clearly state your query event iam not able to track what output your expecting...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 09:05 PM
You can achieve the behavior you described by using Business Rules and Field Dependencies.
Here's how you can create the rule from scratch:
Create the Fields: First, create the necessary fields in your custom table. For example, you might create fields like "State", "Opened", and "Closed".
Create a Business Rule: Business Rules in ServiceNow are used to automate processes and enforce business logic. You can create a Business Rule that triggers when the "State" field is updated.
Define the Business Rule Logic: Within the Business Rule, you'll define the logic to update the "Opened" and "Closed" fields based on the value of the "State" field.
- If the "State" changes to "Opened", you'll set the "Opened" field to the current date and time.
- If the "State" changes to "Closed", you'll set the "Closed" field to the current date and time.
Set the Business Rule Conditions: Specify the conditions under which the Business Rule should execute. In this case, you want the rule to trigger when the "State" field changes.
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 10:29 AM
But my question is more about the logic and definition of dates If you view the task table, the State fields will be automatically connected with the opened, opened by and closed, closed by fields, both are date fields linked with the State
My question is how I could make this same ZERO relationship with new fields created by hand Example, I create a table without changing the task table, and create the fields:
STATUS, Close, Open
How would I list the choices made in the states field to place the Date and time in the Close and Open fields?