cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lolla70
Helper IV
Helper IV

Date formula is not working

Hi All

 

I created a Sharepoint List that include "Check In Date" and "Next Check In Date"

 

I have a button in the App on "TEXT" I wrote 

If(IsBlank(LookUp('Back to Work Eligibility', Employee.Email=VarUserEmail)),
"Check in Required",
"Next Check-In Date " & Text(DateTimeValue(Text(First('Back to Work Eligibility'). 'Next Check-In Date' )), "[$-en-US]mm/dd/yyyy"))

 

On other button the Patch

Patch(
'Back to Work Eligibility',
Defaults('Back to Work Eligibility'),
{
Title: "Status from " & User().FullName & " on " & Now(),
'Check-In Date': Now(),
'Eligibility Status': EmployeeEmail,
Result: lblResult.Text,
'POC Name': ThisItem.'Employee Name'.DisplayName,
'Next Check-In Date': DateAdd(
Now(),
Value(varCheckInDays),
Days
),

 

The button is not updated the Next Date Button on the APP

When I change the formula to "Last" instead of First it works but then all my colors change to black. Cause I need to get the last Next Check - In Date. In the SharePoint it works but it is not updating in the App????

If(IsBlank(LookUp('Back to Work Eligibility', Employee.Email=VarUserEmail)),
"Check in Required",
"Next Check-In Date " & Text(DateTimeValue(Text(Last('Back to Work Eligibility'). 'Next Check-In Date' )), "[$-en-US]mm/dd/yyyy"))

 

 

Any idea??

On other button the Patch

33 REPLIES 33
lolla70
Helper IV
Helper IV

the lblResult_1 OnText Code :

If(
IsBlank(ListBox3_1.Selected.Value),
"Well-check Status Required",
If(
ListBox3_1.Selected.Value = "Home",
"Work from Home",
ListBox4_1.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_1.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_2.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_2.Selected.Value = "No",
"Clear for Office/Field work"
)
)

Thank you so much, It worked. First time it didn't then I deleted everything save and refreshed then paste again and it worked. This exactly what I want. I will try now to publish and test again.

When I check in and close the App the Result doesn't stay in the screen when I open the APP I again. It should stay till next day same as the Check Date . I added Date Add(Today(), 1, Days)" to the code below and it didn't work.

 

the lblResult_1 On Text Code :

If(
Is Blank(ListBox3_1.Selected.Value),
"Well-check Status Required",
If(
ListBox3_1.Selected.Value = "Home",
"Work from Home",
ListBox4_1.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_1.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_2.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_2.Selected.Value = "No",
"Clear for Office/Field work"
)
)

 

Hi @RandyHayes 

I really need your help, I gave up

The Next Check-In stopped working when the result is Work from home

The 

lolla70_0-1614226924549.png

The OnText Code

With({_email: User().Email},

"Next Check-In Date " &

If(lblResult_1.Text = "Work from Home",
DateAdd(Today(), 1, Days),
If(!LookUp('Back to Work Eligibility', StartsWith(Employee.Email,_email),true),
"Check in Required",
With({_records: SortByColumns(Filter('Back to Work Eligibility',StartsWith(Employee.Email,_email)), "NextCheck_x002d_InDate", Descending)},
Text(
With({_utc: First(_records).'Next Check-In Date'},
DateAdd(_utc, TimeZoneOffset(_utc), Minutes)
),
ShortDate
)
)
)
)
)

 

When I logged out and log in to the APP I should see the Result Message and the Date till next day, however it is showing to start from beginning. How I fix this issue?

lolla70_1-1614226973657.png

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,518)