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 Pages / Problem with Web API U...
Power Pages
Unanswered

Problem with Web API Update for Date and Time Column

(0) ShareShare
ReportReport
Posted on by 80

Hi,

 

I am having a problem updating a Date and Time column in my Dataverse table. 

 

var n = Date.now();
	var timestamp = n.toString();
 webapi.safeAjax({
		type: "PUT",
		url: "/_api/TABLE(cdffea91-90ac-ed11-aad1-002248322cfa)/TIMESTAMP_FIELD", 
		contentType: "application/json",
		data: JSON.stringify({
			"value": timestamp
		}),
		success: function (res) {
			console.log(res);
 	}
	});

 

I get

 

absoluteBeginer_0-1677069155624.png

 

 

Question is - how do you update a Date and Time column.

 

Thanks

 

 

Categories:
I have the same question (0)
  • Inogic Profile Picture
    1,135 Super User 2025 Season 2 on at

    In order to update date time column through Web API you must follow steps that is mentioned in below blog

    https://www.inogic.com/blog/2021/03/execute-different-web-api-operations-using-powerapps-portals-preview/

    OR

    You can also refer below code in which it will update the current record with current date and time using Web API from Portal

    <script>

    $(document).ready(function () {

    const datetime = Date.now();

    webapi.safeAjax({

    type: "PATCH",

    url: "/_api/accounts(2130d4ff-b0b1-ec11-9840-0022481e23b4)",

    contentType: "application/json",

    data: JSON.stringify({

       "new_accountrenewed":new Date()

    }),

    success: function (res, status, xhr) {

        var accountid = xhr.getResponseHeader("entityid");

                alert("Updated record :" +accountid);

        }

    });

    });

    </script>

     

    Inogic_0-1678099570811.jpeg

     

    NOTE: Please don’t forget to add site settings and table permissions.

    Hope this helps!!!

     

    If you find this solution helpful, please mark it as the accepted solution.

     

    Thanks!
    Inogic Professional Services
    An expert technical extension for your techno-functional business needs
    Power Platform/Dynamics 365 CRM
    Drop an email at crm@inogic.com 
    Service: http://www.inogic.com/services/ 
    Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/ 

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 Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard