- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 11:20 AM
Hi all,
I currently am creating an automated termination flow. What I have so far:
Trigger: "end date" on sys_user record changes
The first thing I added was to set flow variable value to current:
I created the flow variable "End Date" and am using the "end date" field on the triggered user record
I was using this data pill to populate the catalog item variable, however the records return the sys id.
The "class" field on the [cmdb_ci] table is the only one that makes sense for the catalog item question. So I tried to create a loop and set a flow variable to the class name:
And this is the scripted condition I used:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2022 06:19 AM
So, for the change details, you'll only be able to access by doing a for...each loop against "changed Fields" - then you'll have an if to look for the field name for the end date. If it matches, then set your flow variable to the current value of that found entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 12:40 PM
var endDate = fd_data.trigger.current.u_end_date;return endDateI am trying to have this end date be used later in the flow where I submit a catalog item. However, for the catalog item, it keeps giving me the previous value of the end date field. I want to create a flow variable so that I can use the date that the end date is changed to.
I'm not sure I understand the logic here. You mention setting a flow variable to the user's end date. Are you later re-setting the value to another date? If not, what do yo mean by previous value in comparison to the end date on the user record?
The "class" field on the [cmdb_ci] table is the only one that makes sense for the catalog item question. So I tried to create a loop and set a flow variable to the class name:
On your catalog item, is the field you're trying to populate a single string field? If so, the logic in the flow doesn't make sense because you're trying to pull all the records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 03:44 PM
Hi thank you for your response,
I'm trying to populate variables on the catalog item. I am using the "Submit a Catalog Item" Action in Flow Designer.
So when I run the flow [triggered by change of end date], the new end date value is supposed to be used for the variable on the catalog item. However, when I set the variable value to be the end date of the triggered user record, it is using the previous value and not the new/current value.
This is why I tried to create the loop to set a flow variable to get the current end date, and then use that value for the catalog item variable, but it is still giving me the previous value.
Also, on the catalog item, I am trying to populate a "multi line text" variable with the class field. The way I had it, to pull the records, it was populating the sys_id of the records separated by a comma. To mitigate this, I created the flow variable to return the class value of the record. However, it did not work.
Thanks so much for your response, I hope my explanation helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2022 05:28 AM
For the date change, within your pill picker for "Trigger > Record Updated" you should see a changed fields. You will need to iterate on this to find the end date field and then you'll have available to you the current value - which you can set to the the flow variable you created.
For the classes, within the set of the workflow variable, you'll need to script this. You should be able to dot walk through the fd_data to the current item to get it's sys_class_name, but you will want to have logic to push the new value to a comma separated list so that you get the full list of classes and return the new list. It'll make sense to only add the class to the list if it's not already in the list (indexOf will help here).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2022 04:41 PM - edited 10-21-2022 04:44 PM
Hi Kristen,
I was able to update the class by doing a loop and flow variables.
1. I created the flow variable: CI_string of type "string"
2. Then after my lookup records action, I created a flow logic "for each Configuration Item",
3. I then set the flow variable CI_string to [CI_string][Configuration Item Record.class]
However, I'm still not able to get the current value for the end date change as it is greyed out when I try to select it.