Page tree
Skip to end of metadata
Go to start of metadata

With ConfiForms record you always have access to metadata fields such as 

  • id - the record id, unique for every saved record
  • ownedBy - the username of the user who owns the record (and can fully control it)
  • ownedByName - the full name of the user who owns the recordUse ownedBy.fullName
  • createdBy - the username of the user who has created the record (admin users can create records for other users)
  • createdByName - the full name of the user who has created the record Use createdBy.fullName
  • created - the timestamp when the record was created
  • dateCreatedFormatted - a more readable way to see created timestamp (Uses "yyyy-MM-dd HH:mm" format, if you need "created" date in another format, use Virtual functions, created.formatDate(PATTERN) to get it in the format you want)
 

Accessing this fields is the same as accessing the fields you define

For example, consider a simple form like this:

 

We can build a simple CardView over it's data and to show a createdBy field in addition to defined "mytextfield"

My text field

testing

Created By

Sash [ConfiForms]

 

 

However, ConfiForms does NOT track the last updater by default, but it can be easily added

 

We will use the same form, add a hidden field to store the last updater and update this field with IFTTT on record create and record update

Modifying the CardView like this:

 

Complete storage format for the solution 

<ac:structured-macro ac:macro-id="ea4ce2ca-5009-4af2-a354-c5126a50fcef" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">f1</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="37fd2753-23c4-436c-bb5e-d9ffce5a3f2f" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="restrictions">sash</ac:parameter>
      <ac:rich-text-body>
        <p> </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="ed12368a-7dcf-4d19-9f2b-563feaf83ff6" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">mytextfield</ac:parameter>
        <ac:parameter ac:name="fieldLabel">My text field</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="b87d1150-2428-4a77-a0b5-7b0710e79759" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">updatedBy</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Updated by:</ac:parameter>
        <ac:parameter ac:name="type">hidden</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="e76faef8-953b-4a36-8e7b-ce5ec85c0edb" ac:name="confiform-ifttt" ac:schema-version="1">
      <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
      <ac:parameter ac:name="event">onCreated</ac:parameter>
      <ac:parameter ac:name="title">entryId=[entry.id]&amp;updatedBy=[user]</ac:parameter>
      <ac:rich-text-body>
        <p> </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="207991aa-4e6c-4194-8310-bb48ad407b7b" ac:name="confiform-ifttt" ac:schema-version="1">
      <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
      <ac:parameter ac:name="event">onModified</ac:parameter>
      <ac:parameter ac:name="title">entryId=[entry.id]&amp;updatedBy=[user]</ac:parameter>
      <ac:rich-text-body>
        <p> </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="691c19c2-afa5-4847-8442-6e59f08e4178" ac:name="confiform-card" ac:schema-version="1">
  <ac:parameter ac:name="formName">f</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="c1f02f2f-6a83-4151-9b68-b36fb6772717" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">mytextfield</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="d9a2031a-caeb-48e9-88d6-5829ab13dc7a" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">createdBy</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="c90c2b7d-dcd6-4d13-939e-80d103d16c04" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">updatedBy</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>

 

 

 

  • No labels