Insert Date Value to SQL from DateTime Picker

Scenario:

There is a SQL Server Table Project_Details with a column Due_Date of type datetime. In Canvas Apps, we have a collection named projectDetailsColl in which we are collecting Projects Details like txtProjectName as Text Input, dtpDueDate as Date Picker. The requirement is to save the values from collection to SQL table.

Below is the code for this:

ForAll(projectDetailsColl,
    Patch(Project_Details, Defaults(Project_Details),
    {
        ProjectName: projectDetailsColl[@ProjectName],
        DueDate: DateTimeValue(projectDetailsColl[@DueDate]),
        ModifiedBy: User().Email,
        ModifiedDate: Today()
    })
)
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s