Accessing meta data using Client Library

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Expected behavior

Minimal reproduction of the problem

Environment

App Name:

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [VERSION]

Browser:

  • [*] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Hi Sebastian,

I want to update created on and edited on meta fields using client library is there any way possible?

currently i have created Data fields for created on but for edited on it does get updated while we modify the content, Is their anything in script we can do to update the edited on script every time we update the content. it tried using new Date() method of javascript but it didn’t worked

image

No, these fields are automatically set by the backend.

is their any way we can update dates in field using script

No, they are immutable. Why do you need to upgrade them?

I have a set of data where there is a field of edited on which gets updated every time we update that data so i have to migrate that date and also update it every time it changes here on squidex. I used an approach where I made edit date a datetime field but i can’t find a way to update it every time someone modifies the data

I tried using javascript date feature on update script but i also didn’t worked

The javascript thing could work like this

ctx.data.editedOn.iv = new Date().toISOString();
replace();
  1. The dates are saved as ISO8601, therefore the toISOString call.
  2. You have to tell the scripting system to update the data.