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 / Udating date and time ...
Power Apps
Answered

Udating date and time field in editable grid

(0) ShareShare
ReportReport
Posted on by 301
In my Canvas App , with Sharepoint as data source and 1:M relationship for SP List A to SP List B , I'm create and update my child list using a editable grid and Parent record using a form at the top of the grid.
When my form is in New mode , 
I'm creating record child record using below formula,  colGridExpenData  is the collection from the grid
ForAll(
                    colGridExpenData As itemCC,
                    Patch(
                        SP List B,
                        Defaults(SP List B),
                        {
                            Title: itemCC.Title,
                            ParentIDtxt: Text(SP List A.ID),
                            'Date From': itemCC.'Date From' + Time(Hour(itemCC.'Date From'),Minute(itemCC.'Date From'),0),
                            IsCredit: itemCC.IsCredit,
                            VAT: itemCC.VAT,
                            Currency: itemCC.Currency,
                            'Account Amounts': itemCC.'Account Amounts',
                            Amounts: itemCC.Amounts,
                            ExchangeRate: itemCC.ExchangeRate,
                            SNo: itemCC.SNo,
                            ExpenseFor: itemCC.ExpenseFor,
                            'Expense Type': itemCC.'Expense Type'
                        }
                    )
                )

and Updating it with below formula 

 
Patch(
                SP List B,
                UpdateIf(
                    colGridExpenData ,
                    Created = Blank(),
                    {
                        ID: Blank(),
                        ParentIDtxt: SP List A.ID
                    }
                )
            )


Everything is working fine except my Date and Time field, where its not storing the time in my date field.

Please help me understand the issue .
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,061 Most Valuable Professional on at
    Why are you adding the time again when the field is already Date/Time ? Also the structure below is far more efficient
    Patch(
       SP List B,
       ForAll(
          colGridExpenData As itemCC,
          {
             Title: itemCC.Title,
             ParentIDtxt: Text(SP List A.ID),
             'Date From': itemCC.'Date From',
             IsCredit: itemCC.IsCredit,
             VAT: itemCC.VAT,
             Currency: itemCC.Currency,
             'Account Amounts': itemCC.'Account Amounts',
             Amounts: itemCC.Amounts,
             ExchangeRate: itemCC.ExchangeRate,
             SNo: itemCC.SNo,
             ExpenseFor: itemCC.ExpenseFor,
             'Expense Type': itemCC.'Expense Type'
          }
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    153,061 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps   

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard