Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
7 subscribers
Views
3488 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I wish to generate a random 5=digit ID whenever a process is initiated. For exa
mikec
over 11 years ago
I wish to generate a random 5=digit ID whenever a process is initiated. For example; when a user launches a process I want to have on the form (read-only) a 5-digit ID field where it is populated with this random number and then stored in a PV like submissionID. ...
OriginalPostID-63546
OriginalPostID-63546
Discussion posts and replies are publicly visible
Parents
0
akhilan
over 11 years ago
If you want it random within the process then the rand() function that Mike suggests will work well. Are you looking for a random number across all process instances? You could also leverage, the pp!id of the process instance as it is different for each process instance in Appian. If you are looking for a unique id to identify each submission from the other, you could explore the option of using a database table to store the submission data. Have a primary key associated with each record in the table, which becomes the id you are looking for. Let us say you are using a CDT to save the data into the database table, then you can annotate the primary key field with @Id and @GeneratedValue in the XSD of the CDT. @Id is used to make the field unique and @GeneratedValue is used to make it an autogenerated number. Everytime you insert a record into the table using the Write to Datastore smart service, a new ID will be generated for that record.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
akhilan
over 11 years ago
If you want it random within the process then the rand() function that Mike suggests will work well. Are you looking for a random number across all process instances? You could also leverage, the pp!id of the process instance as it is different for each process instance in Appian. If you are looking for a unique id to identify each submission from the other, you could explore the option of using a database table to store the submission data. Have a primary key associated with each record in the table, which becomes the id you are looking for. Let us say you are using a CDT to save the data into the database table, then you can annotate the primary key field with @Id and @GeneratedValue in the XSD of the CDT. @Id is used to make the field unique and @GeneratedValue is used to make it an autogenerated number. Everytime you insert a record into the table using the Write to Datastore smart service, a new ID will be generated for that record.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data