Skip to main content
Nintex Community Menu Bar
Question

UI Only Field DateTime Calculation

  • Jul 10, 2024 8:45 PM UTC
  • 7 replies
  • 94 views
  • Translate All

Forum|alt.badge.img+6

So I’ve seen that UI only fields cannot do calculations on DateTime fields, just Dates using formulas like this post https://community.skuid.com/t/calculate-age-with-ui-only-field

Has anyone figured a relatively easy method/hack to do this aside from creating formula fields in Salesforce? We want to subtract 1 hour from a Salesforce DateTime field in the Skuid UI.

7 replies

Forum|alt.badge.img+18

ui formula fields can use datetime fields. They are just expressed in milliseconds.

So to subtract an hour, you want

{{Datetime__c}} - (1000*60*60)
Translate

Forum|alt.badge.img+6
  • Author
  • Jul 10, 2024 9:36 PM UTC

I had thought so too but tried that many times in past and doesn’t display. The calculation seemed to work off Date fields to subtract a day but not DateTime. Just tried it now and still get blank. The DateTime field is in the model.

Translate

Forum|alt.badge.img+6
  • Author
  • Jul 10, 2024 9:36 PM UTC

This thread from a bit back seems to confirm. Actually even the dates may not work I might have been mistaken.

https://community.skuid.com/t/ui-only-formula-fields-add-1-month-to-date

Translate

Forum|alt.badge.img+18

What do you get if you change the displaytype of the formula field to Text?

Translate

Forum|alt.badge.img+6
  • Author
  • Jul 10, 2024 9:36 PM UTC

Zip. Output blank so far for Text, Date, DateTime.

But after I saw JDs respons that said this isn’t supported I stopped playing with it esp since seems like would be straightforward if it did work. If I remove the calculation it does display as a DateTime.

Translate

Forum|alt.badge.img+18

That’s so strange. Well, you can do it with a javascript snippet.

Translate

Forum|alt.badge.img+6
  • Author
  • Jul 10, 2024 9:36 PM UTC

Yeah, not super versed in those so try to avoid if can but don’t we now have to put those as static resources also? I’m only passively following the changes in Salesforce but thought that was one of the big things at least coming, even if I get away with it for today.

Translate