Why does my ServiceNow Next Action Date/Time time transform flow not work? - transform

I am trying to create a flow in ServiceNow to update the Next Action Date/Time field to be;
ticket created date/time + 30 minutes
My assumption/logic is based on the information in the URL below...
[https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/administer/flow-designer/reference/date-time-transform-functions.html](Date and time transform functions)
So what I did was include a flow step to update the Next Action Date/Time with the ticket's Created value (data pill) then apply an Add Time transform to the Created value by adding 30 minutes. I also included an unmodified/untransformed copy of the Created value in the Next Action Activity field for reference.
Transform ticket's created date/time
The image below is the output of the flow, the date/time boxed in red in the transformed Created value which should have been only 30 minutes greater than the unmodified/untransformed Created value boxed in green.
Transform results
I am assuming I am doing exactly the same thing as described in the original ServiceNow information page, but I don't know what I am missing?
I tried some further triage to add various times into the work notes to see what is going on, but I've ended up more confused...
Opened: 24-11-2022 12:19:39
Opened (transformed Date to String-ServiceNow): 2022-11-24 01:19:39
Opened (transformed Date to String-ISO): 2022-11-24T01:19:39Z
Opened (transformed+30min): 2022-11-23 17:49:39
Created: 24-11-2022 12:20:19
Created (transformed Date to String-ServiceNow): 2022-11-24 01:20:19
Created (transformed Date to String-ISO): 2022-11-24T01:20:19Z
Created (transformed+30min): 2022-11-23 17:50:19
Did some more triage.
In the image below, I changed the flow so it updated the Next Action Date/Time field with the Opened value (unmodified). The result is that the correct time is displayed.
Next Action Date/Time = Opened value
Then I updated the flow, this time I applied a transform to the Opened value and applied the Add time transform, but I set all the values to 0 i.e. add 0 days, 0 hours, 0 minutes, 0 seconds. In theory it should have been the same result, the Opened value.
But it wasn't, there must be something wrong functionally with my ServiceNow environment.
Next Action Date/Time = Opened value with Transform function "add time" = 0
Any insight, would be appreciated.

Related

NetSuite Saved Search formula to get a field's value as of a given date

I am required to use a saved search to answer the question: how many cancelled Sales Orders did we have on a specified date? I must use a saved search because ultimately it will be something viewed on a dashboard (and this is what the end users are used to). I know that I can and how to complete via SuiteScript; this is explicitly a question related to Saved Searches and/or SuiteAnalytics. The status of our sales orders fluctuates more than a “normal company”, i.e. 1 SO might change status 3 or 4 times before being “done”. My initial thought was to create a saved search and add “System Notes fields…” as results. So I’d have something like the following:
For the given date 7/19/20 the status was “Canceled” since 7/19/20 is greater than 6/12/20 and less than 7/22/20. I would like to get this field’s value on 7/19/20 programmatically and display it as a Saved Search results column but I don’t know how. I think I’m stuck because I don’t know how to tell NetSuite in a saved search to look at the date in the row above or below. Said differently I don’t know how to compare the given date to all the system note dates to find the system note date that is right before (use the old value) or after (use the new value) the given date. In excel I would do the following, how do i do this in a NetSuite Saved Search?
To apply a dynamic date filter:
In the Criteria tab, add a date filter:
Filter = System Notes : Date is on today
In the Available Filters tab, add the same date filter:
Filter = System Notes : Date,
Show in Filter Region = Yes

Reset Increment Variable for Sample ID

I am new to Power Automate flows. I was tasked to create a Unique Sample ID based on parameters from a SharePoint list, when an entry is created. I have created a SharePoint list, whose function is to hold the increment variable, which is my counter. The current flow increments this counter variable, whenever an item is created in the main SharePoint.
The Sample ID is suppose to reset every year based on the logged date of the incident, which is different than the stored date. For example, 2020SPI1, 2020SPI2, and 2021SPI1, 2021SPI2. I am trying to get an idea on how to do this.
I do not want a flow that resets the counter every year, since the stored date of the entry can be different from the date that the incident occurred.
In Order to make your format like 2020SPI1
Step 1: Initialize a vairable named as PatternId
Step 2: Set Variable. You can use string concat function in value of variable as following
concat(formatDateTime(utcNow(),'yyyy'),'SPI',items('Counter')
First argument here will produce current year: 2020.
Second argument is a static string: SPI.
Third your counter value from the list holding incremented number.
Then finally you can use PatternId to updated the id in your list column. Hope this can help you out.

Fetching date value from a SharePoint-list, to use in date&time specific field in flow

I'm trying to design a Microsoft Flow, which will create a outlook calendar event entry based on information in a SharePoint-online list.
The list will contain a value for a DueDate its a column of type Date, not including time.
I want to be able to create a outlook calendar entry on the date based off the duedate column. The calendar entry form in flow allows via dynamic content to add dates that also include time, however date columns not containing time cannot be added that way.
Is there a workaround to this, some expression that would allow me to fetch values from columns more freely and then possible append a time to it
I have tried converting the column in sharepoint to a Date with Time column and that workaround worked, however its not what I'm looking for. Id like to know how to be able to work around this because I don't necessarily want my column as a date-time column which can cause problems later on.
I have tried this expression:
formatDateTime(concat(item()?['DATE'], '08:00')'yyyy-MM-ddThh:mm:ss')
But I know this is wrong and it doesn't work. I'm simply not sure how to do it.
https://puu.sh/Df5ni/05cb882b23.png
I want the flow to add a calendar entry based off the due date column which i can append my own time to like the start of the day and last til the afternoon.
Actual results are I don't seem to be able to use a date column, just a date-time column for start and end times of the event, date column without time doesnt appear in the dynamic content list.
If there is some way to manually fetch values instead of using the dynamic content that is very powerful and can then possibly be converted to the right format using additional code.
Date column name in my list is date_without_time of type Date (Add time set to NO):
New element:
Function used in Create event (V2) action:
formatDateTime(triggerBody()?['date_without_time'],'yyyy-MM-ddT09:35')
Result:
Calendar:

Run informatica load with automatic date increment

I need to create an on demand task to load data for say one month, with date increasing automatically by 1 everytime, till it reaches the month end date.
The data of next date depends on the previous data, so i cant't give the date range and run them altogather. It should load for next date only when previous date data is loaded.
EG: starting from 1 april, it should load dat for 1 april, then automatically increment the date by 1, load data for 2 april, and so on.
Someone please help, how this can be done.
If possible, I would prefer to load data in a single session run, instead of running it multiple times.
You can use a mapping variable to keep track of the current date. Initialize the mapping variable with the beginning date using parameter file. In your mapping set the variable to the next day using the SETVARIABLE function. So, when you rerun the mapping the new value of the date will be used.
However, you have to run the mapping multiple times, which you can do using a shell/batch script.

How can I set the default value of a DateTime field in a SharePoint list to also contain the current time?

I have a DateTime field in my SharePoint 2013 list. I have specified the default value for the field to be =Today. The problem is this only specifies the date part of the field. The time part is left as 00:00. How can I get the time information in there as well.
I want to present the user with the current time as default, which will be used most of the time. However, it should be possible for the user to be able to specify a different time if required.
=Today() gives only the current date, =Now() gives the current date and time.
yourDefaultDate = DateTime.Now();
instead of DateTime.Today();

Resources