Hello,
I attached code from the Address Management Solution that uses sequence values. Someone can correct me if I am wrong but you don't create a sequence value using Arcade. Instead you can use a sequence value that has already been created in your FGDB. The "Create Database Sequence" tool. Will allow you to create a new sequence with a starting id and increment value. Once you run the tool then you can use Arcade to get the sequence.
I hope that helps.
Reference:
https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-database-sequence.htm// This rule will create a new unique id when an address point is created
//Trigger: insert
// Define the id field
var id_field = "addressptid";
// If the feature id is not blank or null return
If (!HasKey($feature, id_field)) return;
var id = $feature[id_field];
If (!IsEmpty(id)) return;
// Define the name of the database sequence and the format for the id
// Text on either side of the ${ ... } will be added to the id
id = `ADD-${NextSequenceValue("AddressPointID")}`;
// Return the new id
return {
"result": {
"attributes": Dictionary(id_field, id)
}
}