Skip to main content
Inspiring
March 11, 2021
Question

Issue in Write to data store entity

  • March 11, 2021
  • 5 replies
  • 0 views

Hi All,

I facing challenge in write to data store entity I have one Primary key field "ABC" of type unique(TEXT) and another field "XYZ"

which is of type number with auto increment now while passing the data from appian Im passing both field as blank My requiremnt is to the field "XYZ" to be auto populated

kindly help

5 replies

peter.lewis
Participating Frequently
March 11, 2021

Is there a reason the auto-increment field isn't set as the Primary Key? It's usually better practice to have an integer field as the PK, and you could certainly still make "ABC" a unique field even if it isn't the PK.

New Participant
March 11, 2021

Hi Peter,

We don't want to display the Primary key field information to the user as it can be a security issue.

Hence on customer request we are creating one more column which we have kept as number and auto increment and same will be used for linking the record.

As per my knowledge, when we map the primary key in cdt then after selecting on the checkbox and marking it as auto increment we don't need to pass the same while using write to datastore entity.

so for requestNumber field we have given the below configuration in the XSD so that it can be auto genrated while writing the data

<xsd:element name="requestNumber" nillable="true" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@GeneratedValue @Column(name="RequestNumber", nullable=false, unique=true, columnDefinition="BIGINT IDENTITY")</xsd:appinfo>
</xsd:annotation>
</xsd:element>

mikes0011
Brainy
March 11, 2021

You should still make the PKID an auto-incrementing integer.  If you require a unique identifier that's exposed to the end user, just create that as an additional column and validate its uniqueness within Appian - that could be number, text, or both as per your requirements.

The Expression Guru