Jump to content

Date Format in Authorisation Task


SJEaton
 Share

Recommended Posts

Hi, I have a custom field which pulls through into an authorisation node which is then obviously displayed in the authorisation task sent to the authoriser.  I've used h_custom_22 so as it pulls through as a DD-MM-YYYY format as I thought this meant I wouldn't need to do a date conversion but its still displaying as YYYY-MM-DD in the task (see Payment Due Date in example attached).  Why is this??  (It displays fine in other auto-emails where its used)

Sam

Capture.PNG

Link to comment
Share on other sites

Guest Ehsan

Hi @SJEaton,

Hope you're doing well.

You can use the date function in wiki markup to apply the correct format based on your Profile's regional settings.

In the Business Process - Within the Authorisation Task definition, you'll have to wrap the variable as below:

  • [date: VARIABLE]

In the example below, the value that is injected by the Variable Picker is wrapped inside [date:  ] which outcomes to [date: &[functions.pcf("askAQuestion","selectStartDateTime")]].

image.png

 

I hope this helps.

Ehsan

Link to comment
Share on other sites

Hi @Ehsan

I wrapped the variable inside [date:  ] but its not quite worked. 

I have [date:&[global["flowcode"]["customField22"]]]  but its outputting as [date:2019-02-26 00:00:00]

Can you advise how to amend? Thanks

Sam

Link to comment
Share on other sites

Guest Ehsan

Hi @SJEaton,

Sorry my mistake, [date: ] is a wiki-markup syntax which can for example, be used when providing an update in the Details section.

When handling values that are driven by the Variable Picker in the BPM, you simply need to wrap the variable inside [].

In the example below in my Business Process, a Progressive Capture answer is wrapped inside [].

image.png

 

When viewing the Request, this value is shown as below.

image.png

I hope this helps.

Ehsan

Link to comment
Share on other sites

Hi @Ehsan, nope still not working for me.  Must still be doing something wrong.  

This is what I've entered:

Original Payment Start Date:  [&[global["flowcode"]["customField22"]]]
Original Payment End Date:  [&[global["flowcode"]["customField23"]]]
Proposed New Payment End Date:  [&[global["flowcode"]["customField24"]]]

This is what displays:

Original Payment Start Date: [2019-02-26 00:00:00]
Original Payment End Date: [2019-04-03 00:00:00]
Proposed New Payment End Date: [2019-04-05 00:00:00]


Sam

Link to comment
Share on other sites

  • 2 weeks later...
Guest Ehsan

Hi @SJEaton,

Spent the morning looking into this; I assumed that it is possible because in My Profile, the preferred date time format was set to YYYY-MM-DD and hence it looked correct to me... but I then went on to update the preferred date time format in My Profile and I can see that the format isn't changed :(. The date time value is parsed and stored in the description of the task at the point of creation, I checked the database and I can see that the date time value is stored (rather than a reference to the column that the value belongs to), so it won't be possible to load the value on a user by user basis based on their date time format preference. The description field in a task doesn't support wiki-markup by the looks of it and there are no plans at this moment in time to support it unfortunately.

Link to comment
Share on other sites

Guest Ehsan

@SJEaton @Paul Alexander,

As this was bugging me (I knew I had it working somehow...), I looked into it again this morning and here's some concrete findings...

I have a Progressive Capture that is associated to a Catalog. Within the Progressive Capture, I have a custom form...

image.png

And a field within the custom form. Please note that the Field ID is startDateTime and the Field Type is Date & Time control.

image.png

In my Business Process, I have added Entity > Requests > Get Request Information > Progressive Capture Answers automated task. This step is crucial in my findings.

image.png

In my Human Task, I have used the Variable Picker to locate my field and Inject the variable into the Task details section as below...

image.png


The injected variable looks like below... I had to wrap the injected variable in between brackets [ ].

image.png

 

I then went on to change my Date Time Format to below. I had previously missed this part - You have to logout and login again for this to take effect.

image.png

I then went on to raise a Request against my Catalog and prompted to select a Date Time in my custom form.

image.png

 

When viewing the task, my preferred Date Time Format is correctly applied.

image.png

 

The above is scenario in which Date Time Format will be correctly applied.

Here's a scenario where the Date Time Format won't be applied and I believe this is what you're doing @SJEaton,

So you have a field in your Request details where you capture Date Time. e.g. "Expected Delivery Date" in the example below. It doesn't actually matter where you're capturing it from - The important note is that it's being saved into h_custom_22 column.

image.png

In your Process,  Entity > Requests > Get Request Information > Request Details automated task returns the Request data and you've used the Variable Picker to inject a value as below.

image.png

And when viewing the task, it looks like...

image.png

 

So I can replicate it. I can see why that is - The raw value is stored against the task, hence the timezone information is missed. I will need to speak to the team internally to understand what can be done here.

Link to comment
Share on other sites

Hi @Ehsan

I think my problem may be slightly different........in my example, I'm not getting info from the PCF necessarily, I'm just asking an analyst who is dealing with the request through an Activity to enter a date in a date/time field. this particular field is not conforming to the date format settings of the analyst (in my case above, my date format settings show dd-mm-yyyy but the date picker in the form is showing as yyyy-mm-dd

Which seems a little bit of a let-down after you very in-depth explanation ;)

Is this a separate problem do you think?

 

Link to comment
Share on other sites

Guest Ehsan

@Paul Alexander - The issue in relation to Custom Fields in Tasks presenting ab un-formatted Date Time value on selection - This has been accepted as a defect by our development team.

@SJEaton, we also looked into the issue that you mentioned here. It will require further investigation, we will get back to you as soon as I have more update on this.

 

Link to comment
Share on other sites

Thats helpful thanks @Ehsan

3 hours ago, Ehsan said:

I then went on to change my Date Time Format to below. I had previously missed this part - You have to logout and login again for this to take effect.

image.png

Where do you change this?

Sam

Link to comment
Share on other sites

Guest Ehsan

Hi @SJEaton,

The development team have added code to wiki markup to cater for the DATETIME value that is returned by custom22 and other DATETIME fields. In the next Hornbill Collaboration build, if you wrap the value in custom22 in square brackets, it should show in the UI as your Profile's format.

As below:
[&[global["outputParams"]["custom22"]]]

Thanks,

Ehsan

Link to comment
Share on other sites

  • 4 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...