web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Time Tracker app by Ra...
Power Apps
Unanswered

Time Tracker app by Randy Hayes

(0) ShareShare
ReportReport
Posted on by

I have created the application by Randy Hayes.  Video

(36) PowerApps Time Tracker - YouTube

PowerApps Time Tracker

Randy Hayes

 

 

What I need: 

Has anyone had experience in changing the Backend Data to SQL SERVER from sharepoint ?

 

Thanks

David

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    There is no simple way to do it. Basically you need to find every reference to the SharePoint Data source and replace it with a similar reference that points to a SQL table.  Most of the syntax will be almost exactly the same. There will be a few differences, but delegation in SQL is better than SharePoint so it should be an easy, but time consuming conversion.

  • Community Power Platform Member Profile Picture
    on at

    i have the conversion working except for reading the data back from sql server into the application on a column for "datetime", can't get the value to read at all from sql server, All the other fields come in just fine.
    But yes, I created a table in sql server spot on to the sharepoint List Column..settings

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    What SQL data type is the date time column? SQL has several different date time types.

  • Community Power Platform Member Profile Picture
    on at

    @RandyHayes ,  coffee is on the horizon !! ?,
    Thanks  

  • Community Power Platform Member Profile Picture
    on at

    "datetime"

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Are you using a Patch or is it a SubmitForm?  Can you show me the code you are using?  Date Time should work.

  • Community Power Platform Member Profile Picture
    on at

    The patch Code works fine, when inserting data into sql server.

    It's reading the data back into the app is the issue.

     

    The data in ActivityDate in sharepoint looks like this :

    06/06/2023 11:45 am

    The data in sql server looks like this:

    2023-06-06 11:45:34.000

    Also i created a view in sql server to make the field look like this: and changed the datasource to the view, but still did not work.

    06/06/2023 11:45:34 am

     

     

    here is the  code:  from the "data_card" object in the instruction video.  "Update" property

    With({lclRecs:Filter(T_NSC_TRACKCODE_TimeTracker,

    Title = glbUser && StartsWith(ActivityDateTime,

    Text(Today(), "[$-en-US]yyyymmdd")))},

    {
    CheckIn:LookUp(lclRecs, ActivityType= "Clock In", ActivityDate),      <--------  NOT READING THIS LOOKUP
    CheckOut:LookUp(lclRecs, ActivityType= "Clock Out", ActivityDate),
    LunchOut:LookUp(lclRecs, ActivityType= "Lunch Out", ActivityDate),
    LunchIn:LookUp(lclRecs, ActivityType= "Lunch In", ActivityDate),
    Break1Out:LookUp(lclRecs, ActivityType= "Break1 Out", ActivityDate),
    Break1In:LookUp(lclRecs, ActivityType= "Break1 In", ActivityDate),
    Break2Out:LookUp(lclRecs, ActivityType= "Break2 Out", ActivityDate),
    Break2In:LookUp(lclRecs, ActivityType= "Break2 In", ActivityDate)

    }
    )

    i have tried the following:

    Text(DateValue(ActivityDate,DateTimeFormat.ShortDateTime))

    And

    DateValue(ActivityDate,"mm/dd/yyyy hh:mm:ss a/p"))

    And 

    Text(DateTimeValue(ActivityDate,"[$-en-US]mm/dd/yyyy hh:mm:ss"))

    Thanks for replying ...Very much appreciated

    Dave

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    If you look at the SQL database does the ActivityDateTime text field contain Today's date in the format of yyyymmdd?  The Lookup may be working, but the With may be returning no records for the Lookup to work with.  Can you show a printout of some of the SQL records? I suspect the problem may be something simple like case sensitivity or spelling on the Check in Type entry.

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @Anonymous 

    Datetimeoffset is the better data type to use because there are known problems with filtering/querying SQL columns that are of data type 'datetime'.

    If possible, I would try changing the data type to datetimeoffset to see if that makes a difference.

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Its just retrieving the DateTime, not querying on it.  The query is against a text column called ActivityDateTime.  Randy wrote it that way to avoid having to filter on a combined DateTime column.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard