Dollar Sign Notation

The dollar sign notation is used to copy values from one field whose path is specified inside the dollar sign notation to the one where the dollar sign notation was specified. The path defined in the field is a relative path and can only refer to fields that are passed when the object is posted or to fields that are generated by the backend before it gets saved to the database.

The dollar sign notation is a string has the following format:

${<integer>/path/to/other/field/value}

Probably the most common and simple example is the one for signatures and Note number. Consider the following simplified Note Edit Invitation:

{
  id: "OpenReview.net/Venue_Organizers/-/Submission",
  signatures: [ "OpenReview.net/Venue_Organizers" ],
  writers: [ "OpenReview.net/Venue_Organizers" ],
  invitees: [ "~" ],
  readers: [ "everyone" ],
  edit : {
    signatures: { param: { regex: ".+" } },
    readers: [
      "OpenReview.net/Venue_Organizers",
      "${2/signatures}"
    ],
    writers: [ "OpenReview.net/Venue_Organizers" ],
    note: {
      signatures: [ "OpenReview.net/Paper${2/number}/Authors" ],
      readers: [ "everyone" ],
      writers: [
        "OpenReview.net/Venue_Organizers",
        "${3/signatures}",
        "OpenReview.net/Paper${2/number}/Authors"
      ],
      content: {
        title: {
          value: { param: { type: "string" } }
        }
      }
    }
  }
}

Then a valid Note Edit replying to this Invitation will look like this:

{
  signatures: [ "~Test_User1" ],
  note: {
    content: {
      title: {
        value: "This is a title"
      }
    }
  }
}

The final Edit that will be saved to the database after all values have been resolved will look like this:

{
  signatures: [ "~Test_User1" ],
  readers: [
    "OpenReview.net/Venue_Organizers",
    "~Test_User1"
  ],
  writers: [ "OpenReview.net/Venue_Organizers" ],
  note: {
    signatures: [ "OpenReview.net/Paper1/Authors" ],
    readers: [ "everyone" ],
    writers: [
      "OpenReview.net/Venue_Organizers",
      "~Test_User1",
      "OpenReview.net/Paper1/Authors"
    ],
    content: {
      title: {
        value: "This is a title"
      }
    }
  }
}

According to the Note Edit Invitation there are only 2 fields that the user needs to fill up: signatures and the value of the title because those are the only 2 fields with the param keyword. The rest of the field values are populated by what is defined in the Invitation as constants. Refer to the Specifiers subsection for more information.

There are 3 fields that contain the dollar sign notation and 4 values that need to be resolved. Let us start with the one inside edit/readers/1. The value ${2/signatures} means that it will go up twice and then select the value of edit/signatures. Note that the value here is [ "~Test_User1" ]. The array will replace the value where ${2/signatures} would be located in the Note Edit and then flattened. In a similar way, the value inside edit/note/writers/1 will be resolved and flattened. The only difference is that the relative path is different, but they resolve to the same value.

The other example refers to the field number. This field is not defined when the Note Edit is posted, because it is created by the backend. However, the field can be referred to when creating the Note Edit. The number field is the only exception to the rule where all the field values that can be referred to with the dollar sign notation need to be present when the Note Edit is posted. As you can see, when the Note number value is resolved it replaces the value of the dollar sign with the number of the Note.

The dollar sign notation cannot refer to values that are at the root of the Invitation. This is because when an object is created, it only has access to its own fields, not to the fields of the Invitation that allows its creation.

Last updated