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
10 replies
Subscribers
11 subscribers
Views
4279 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
Requirement is to display different images for different records in the record l
rajeshwers165
over 9 years ago
Requirement is to display different images for different records in the record list view. Plan is to store the image in Documents and then have the Doc ID of the document placed in the corresponding record in the SQL Server database.
What is the correct data type and length for storing the document identification number? On a related note, when the application is moved to higher environment, will the Doc ID be retained as is or should I have a process to validate this?...
OriginalPostID-131507
OriginalPostID-131507
Discussion posts and replies are publicly visible
0
jamesw353
over 9 years ago
From what I can tell the document ID is always an integer, easy enough right? The tricky part is moving between environments. I've observed that the id is anything but static and not a good reference.
The solution will of course depend on your situation. The way I've done this is to use a constant of type "Document" to store the reference to the actual document in the system. This reference will stay up to date through updates, migration, or whatever. Then I use some other field in the record (status, loan type, user, or anything really) to determine which image is selected for the listing.
This approach works well if the image is pre-determined in the system, if it's unique to each record and can't be pre-determined this probably won't work.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim Nguyen
Appian Employee
over 9 years ago
Doc ID's are not the same across environments. This means that the Doc ID for image A.jpg may be 15 on DEV, but once imported to Test the environment will assign it ID 21.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
I suggest you store the UUID instead, this way even if the document gets deleted and replaced you won't need to update the DB. For this you will need the Content Details by UUID plug-in
forum.appian.com/.../summary
1. You can store the UUID of the document using the following expression to retrieve it and then store by your preferred mean in a column of type text (e.g.varchar) in your table
=keyval(getcontentobjectdetailsbyid(document(ri!myDoc,"id")),{"UUID"},":",",")
2. You can later "transform" it in a document by retrieving the UUID from the DB and converting it to a document object:
=todocument(keyval(getcontentdetailsbyuuid(pv!retrievedUUIDFromTable),{"Id"},":",","))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rajeshwers165
over 9 years ago
Thanks Tim and Eduardo!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rajeshwers165
over 9 years ago
Thanks James!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jamesw353
over 9 years ago
Well the document UUID is a new one on me. I'll definitely be grabbing that plugin, very cool Eduardo.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
hajii
over 9 years ago
In 7.7 I don't see the UUID detail by document id. Missing something? Eg getcontentobjectdetailsbyid(30073) returns:
Content Object[ Name=avatarCAOF9KPO.jpg Parent= Test Folder Type: Document
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
That output doesn't look complete. Can you simply run
=getcontentobjectdetailsbyid(30073)
no other functions and see if you get the UUID? If so then I'll need to see why keyval is not working. Also make sure you download the latest version.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
hajii
over 9 years ago
Ok it works, I had an old version. Question: is it possible to add a folder to an application and also automatically add everything under that folder? It looks like one has to manually add the subfolders and docs to the application? That's not feasible if there are lots of them; a solution for that would be great.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
hajii
over 9 years ago
Never mind please. There's the "Add Contents" for that.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel