Hi, I am making an Asset Management application.
I have a functionality which allows me to create new assets with information such as asset name and asset Id. There is also an ability to add images of the asset in the interface where I have used the a!fileuploadfield which points to a constant which is a folder that stores the images. Here is the code for the same.
/*a!fileUploadField(*/ /*label: "Asset Image",*/ /*labelPosition: "ABOVE",*/ /*target: cons!G1_folderAssetImages,*/ /*value: ri!G1_Assets.imageId,*/ /*saveInto: ri!G1_Assets.imageId,*/ /*required: true,*/ /*validations: {}*/ /*),*/
I want to make a summary view (Interface) which shows all the information about the asset along with its image. But as of now I am just able to show the image id. Is there any way I can dsiaplay the image in this new interface?
Discussion posts and replies are publicly visible
You can use a!documentImage() and pass the document id in a Image Field Component.
But since I am trying to save the images in a folder, it doesn't work using a!documentImage()
So what?? all the documents are stored in a folder.Can you share what you are trying and what is causing the problem?
The error: Could not display interface. Please check definition and inputs. DocumentImage components must be directly contained within one of the following: image field, image column, rich text image, billboard, or hierarchy field node.Code:a!documentImage( document: ri!G1_Asset['recordType!{76ae75aa-111e-4d82-831b-66439437307e}G1 Asset Inventory.fields.{9b94dcb7-d02d-4a6f-8590-eaa380fe5792}imageId'], altText: "Image" )
You need to put a!ocumentImage() in imageField(). Copy below code.
a!imageField( images: a!documentImage( document: ri!G1_Asset['recordType!{76ae75aa-111e-4d82-831b-66439437307e}.fields.{9b94dcb7-d02d-4a6f-8590-eaa380fe5792}'], altText: "Image" ) )
I tried doing that as well, but I get this error. Can you please tell me what am i doing wrong here? I have the admin rights to this application.Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!imageField [line 91]: User Does Not Have Rights to Perform this Operation
Make sure that you have enough rights to view the contents of the folder in which you are saving your document.
This is the image for the security of the document, I tried giving all the possible groups viewing rights. Still I get the same error.
You're trying to display the image before submitting the form - this won't work. Prior to form submission, newly-uploaded files are only stored in a special "temporary" location in the Appian back-end, and are not accessible via regular functions, even document(), documentImage(), etc. After a "submit" click, the document is moved to its proper destination and these things will work as expected.
What you'll need to do here is have the user upload any image(s) and submit the form, then have your process chain to a new task (or even back to the same form) whereupon the image in question will be ready to be displayed.