SJEaton Posted January 16, 2018 Posted January 16, 2018 Hi All I'm trying to configure a workflow so that it takes the Date/Time entered in a question on the procap and converts it to the format dd/mm/yy hh:mm so that it looks nice in an autoemail that is then generated. I've done a similar thing before where I converted just the date (see attached) but can some please advise me what to enter in the input and output formats if the field I am converting is a date/time picker? Also if in this instance the custom field is h_custom_e do i just replace CustomFieldA with CustomFieldE in the example below? Thanks Sam
James Ainsworth Posted January 17, 2018 Posted January 17, 2018 Hi Sam, I haven't tried using this to convert a Date/Time field, only a date field so I can't say if if it works or not. But there is a help icon on some of the operations that can provide some info to help you out. It suggests the following page for the input formats: http://php.net/manual/en/function.date.php I will do my best to test this out, but do let me know if you manage to get this working Regards, James
SJEaton Posted January 17, 2018 Author Posted January 17, 2018 Hi @James Ainsworth I've tried a few things but I'm not having any luck, it keeps returning 'undefined' in the email template Sam
Victor Posted January 17, 2018 Posted January 17, 2018 @SJEaton what is the process where you are doing this and can you please give me a request reference example where you tried this and it did not work
SJEaton Posted January 17, 2018 Author Posted January 17, 2018 Hi @Victor The BP is TEST Business Support - Minute Taker Request (with date conversion). See attached example of where it didn't work.
SJEaton Posted January 19, 2018 Author Posted January 19, 2018 Hi @Victor, any luck with sussing this out? Sam
Victor Posted January 19, 2018 Posted January 19, 2018 @SJEaton no, sorry, didn't have a chance to look yet, will try and have a look later today...
Victor Posted January 19, 2018 Posted January 19, 2018 @SJEaton the date/time value in the custom field is stored as YYYY-MM-DD HH:MM:SS. This is the, let's call it, calendar date/time format,that needs to be "translated" into the integration node date/time format (PHP date formatter) for "Input format" field. So, looking at the PHP date formatter page (http://php.net/manual/en/function.date.php) we have the following: for YYYY - the format we need is: Y - a full numeric representation of a year, 4 digits for MM - the format we need is: m - numeric representation of a month, with leading zeros for DD - the format we need is: d - day of the month, 2 digits with leading zeros for HH - the format we need is: H - 24-hour format of an hour with leading zeros for MM - the format we need is: i - minutes with leading zeros for SS - the format we need is: s - seconds, with leading zeros So the input format should be (taking into consideration dashes, colons and spaces): Y-m-d H:i:s Have you tried this input format? (EDIT: the case is important here as the format is case sensitive) P.S. Apologies, I did not have chance to look at the example you posted, but I thought to confirm the input format that is being used...
SJEaton Posted January 22, 2018 Author Posted January 22, 2018 Thanks @Victor, I know I've definitely tried something similar but not sure if this exactly so I will use this input format and let you know what happens. Sam
SJEaton Posted January 22, 2018 Author Posted January 22, 2018 Hi @Victor, you mention YYYY-MM-DD HH:MM:SS and d/m/Y H:i:s as both the input field so I'm a bit confused. Should one of these be the output format? I tried it with YYYY-MM-DD HH:MM:SS as the input format and d/m/Y H:i:s as the output format but it didn't work? (still pulled through as undefined) Sam
Victor Posted January 22, 2018 Posted January 22, 2018 @SJEaton I mentioned "YYYY-MM-DD HH:MM:SS" being the format in which the date value is stored in the custom filed. You only use this information to help you build the correct input format for the conversion node. So, if the date value is stored in the custom filed as 4 digit year(dash)2 digit month(dash)2 digit day(space)2 digit hour(colon)2 digit minute(colon)2 digit second then you sort of "translate" this into the input format according to the format used by PHP Date format. So, going back to the definitions I made in my previous post, the above becomes, in the input format for the conversion node: Y-m-d H:i:s (which is what I said in the above reply should be used as input format). You might have noticed I haven't mentioned anything about the output format. The output format will be whatever format you need to be displayed in the email. If you want the slashes instead of dashes and have the day, month then year displayed, then the output format (again, according to the format used by PHP Date format ) would be: d/m/Y. If you want to add the time information to this, then output format becomes: d/m/Y H:i:s... if you don't need the seconds then only use d/m/Y H:i ...etc. You can adapt the output format as needed. Does this make sense?
SJEaton Posted January 23, 2018 Author Posted January 23, 2018 Hi @Victor, it does make sense but its still returning 'undefined'. I've attached the request parameters I've entered to see if you can spot what I'm doing wrong? Sam
Victor Posted January 23, 2018 Posted January 23, 2018 @SJEaton can you please give me the latest request reference where you tried this and it did not work?
Victor Posted January 24, 2018 Posted January 24, 2018 @SJEaton I looked at SR00017505 could not see anything wrong and then I had to run another test (SR00017761 - which I cancelled, sorry for the notification email) as I could not understand why it would not work... then looking at the process I see that you don't actually capture (or get) the value for the custom filed prior to pass it to the conversion node... you can see what I mean if you try to set the value for the Date parameter using the flowcode variable picker: As you can see, there is no flowcode that would give you the custom E field variable... the "&[global["flowcode"]["customFieldE"]]" ... therefore it will be "undefined". Perhaps the value for the Date parameter was manually typed in or copy/pasted from somewhere else? If yes, then I would advise against this practice, best way would be to always use the variable picker to make sure the variables are available to the node... So, to summarise, your process needs a "Get Request Information - Request Details" node somewhere before the conversion node. Once this is done you will see the variable picked for the Date parameter in the conversion node will have a variable for custom filed E...
SJEaton Posted January 25, 2018 Author Posted January 25, 2018 Hi Victor The Date/time isn't entered manually anywhere it is definitely captured in the PC so I will add the get request details node and re-test, thanks Sam
samwoo Posted March 7, 2019 Posted March 7, 2019 Hello, Jumping on this bandwagon... very late (I hope that's ok). I am struggling to convert the Integration Calls - Utlities\Get Timestamp (14 days from now) format from 2019-03-21T10:37:53.000Z to 21-03-2019 Using the Integration Call Utilities\Date Formatter I have the following Integration node to get the date in 14 days from now: I am then using another Integration Call to convert the format of this date... this is what I have so far: I am then attempting to update the timeline with &[global["integration"]["date"] (as per the variable picker)... but it comes back empty/blank in the timeline. Can someone advise? I have a feeling it has something to do with the input format... Thanks, Samuel
Victor Posted March 7, 2019 Posted March 7, 2019 54 minutes ago, samwoo said: I have a feeling it has something to do with the input format... Search your feelings; you know it to be true! This should work fine: If not, try and use the SQL timestamp variable: &[global["integration"]["timestampSql"]]
samwoo Posted March 8, 2019 Posted March 8, 2019 22 hours ago, Victor said: Search your feelings; you know it to be true! This should work fine: If not, try and use the SQL timestamp variable: &[global["integration"]["timestampSql"]] Hi @Victor, Thanks for responding. After playing around with this for ages using your suggestion, i finally got this to work! The reason it wasn't working because the 2 integration calls had the same "Result Refrence" name in there... it appears there is no validation checks on this field when Publishing the BPM. Please can I request this feature? I cant believe it took me that long to work it out though (facepalm) Thanks for your help, Samuel
Victor Posted March 8, 2019 Posted March 8, 2019 5 minutes ago, samwoo said: Please can I request this feature? You can... However, I am no the one that can say if, how, when... Glad to hear you worked it out
samwoo Posted March 8, 2019 Posted March 8, 2019 8 minutes ago, Victor said: You can... However, I am no the one that can say if, how, when... Glad to hear you worked it out Ok I would like to request that feature xD Thanks again!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now