0

Everything was working fine until the update of components 1-2 days ago. Without any change to my specific code block. TimeUnit.anything is no longer recognized. I can still use e.g. TimeUnit.Hours in the canvas app area, the problem only occures in the components tab.

Why does this error occur? TimeUnit.XXX is a built in function...

In my PowerApps app, I have a component with the "function" getTextFromTimeRounded, shown in this image:

properties of getTextFromTimeRounded

My code:

If(
    IsBlankOrError(timeValue);
    "";
    DateDiff(Now(); timeValue; TimeUnit.Hours) >= 24;
    $"ca. {Round(DateDiff(Now(); timeValue; TimeUnit.Hours) / 24; 0)} Tag(en)";
    DateDiff(Now(); timeValue; TimeUnit.Minutes) >= 60; 
    $"ca. {Round(DateDiff(Now(); timeValue; TimeUnit.Minutes) / 60; 0)} h";
    $"{DateDiff(Now(); timeValue; TimeUnit.Minutes)} min"
)

Every TimeUnit.XXX is marked as an error, "TimeUnit.Hours is not recognized", but it works fine in the canvas.

Code Block with TimeUnit marked as error

domi
  • 13
  • 1
  • 4
  • UPDATE: The error is still there.... but somehow it works now.. i don't know whats going on... the error is there but it's also not there... – domi Jun 16 '23 at 11:47
  • There is currently a known issue with accessing enumeration values (such as TimeUnit.*) inside components; this is being fixed by the Power Apps team, and I believe the fix should be completed today. – carlosfigueira Jun 16 '23 at 14:19
  • Oh thank you a lot! – domi Jun 19 '23 at 09:29
  • This should have been fixed already, please let me know if you still see this issue. – carlosfigueira Jun 19 '23 at 14:12

1 Answers1

0

as carlosfigueira mentioned, this issue has been fixed

domi
  • 13
  • 1
  • 4