WRITE TO DATA STORE ENTITY
BASIC SETUP - WRITE A SINGLE ROW TO THE APPIAN DATABASE
Assumption: You have already created a Data Type and it is saved in your application's Data Store (as a Data Store Entity). You typically cannot write to the database from Appian without first creating a Data Type (a Data Store Entity).
Video link to an example or continue reading.
Inside the Write to Data Store Entity node, click into Data > Inputs > Data Store Entity > Browse (magnifying glass):
In the Choose an Entity dialog, find your application's Data Store, and then click into it:
Now, find your Data Type, then click Select, and then OK:
Click New Input:
Click on the input that was just created (in this case, Param3):
Click Browse (magnifying glass):
Find your Data Type, then click Select next to your Data Type, and OK:
At this point, you have three options:
If you want to draft the row to be written field by field, click the + sign on the left, then edit each field
If you already have the data to be written saved into a process variable, use the ▼ button, and it will appear as a recommendation, assuming the process variable is of the correct type
If you would like to draft the row to be written inside an expression, use the blue Edit icon (pencil)
WRITE MULTIPLE ROWS TO A DATA STORE ENTITY
If you would like to write more than one row to the Data Store Entity at once, click Multiple:
Note that if you are using a process variable to do so, that process variable must be configured as multiple as well, under File > Properties > Variables > (Select your variable) > Multiple (Variable can store multiple values). If not properly configured, you may find that only a single row is written to the database.
SAVE THE ID OF THE WRITTEN ROW BACK TO THE PROCESS VARIABLE
If you would like to write the identifier of the written row back into the process variable, you can use the Stored Values option, under Outputs > Results > Stored Values.
Under Target:
You can use the +V icon to automatically create a new process variable to save this data
Or (recommended), you can save it back into the same variable that you were using (pv!TST_timesheetLog in the example above) by pressing ▼
This will make it so that if you were writing a process variable to the database, such as:
{id: NULL, name: "Adam"}
This option would save the identifier back into a process variable, such as:
{id: 12, name: "Adam"}
Where "12" would be the identifier of the new row written to the database.