I've attempted multiple times to display images saved in our branding folder in Appian, but each time I receive an error that the image does not exist. I've tried using the doc 'name', 'ID', and the UUID. Does anyone have any tips? I've even tried saving the docs to the knowledge center instead of a regular folder. It would be helpful to see an example of coding. I'm not even able to display our logo.
Thanks for any help!
Discussion posts and replies are publicly visible
I'd suggest using a constant to reference your document. Then, it will be easier to use it within any interface on any environment. For example, suppose I upload a document called My Logo. Then, I'd create a constant to point to it like this:
Then, you can reference it in any interface using the a!documentImage() function:
a!imageField( images: a!documentImage( document: cons!PDL_DOC_MY_LOGO ) )
If that doesn't work, can you provide more information about what you have tried?
How about the dynamic image stored in the artifact folder? Like if I have smart service to generate a QR code and want use the generated QR code in my interface how to do that.
Generate QR Code & Bar Code smart services are there (Plug In) , that smart service saves the generated files in a target folder . Showing it in a user Interface you can handle it in multiple ways .One would be user input task after generation
Yes, But how to show the generated image in my interface?
1. User Input Task after Generate QR Code node. Just pass the generated document.
2. If you are saving generated document in DB , Get the Document ID from there .
3. Create a Constant for generated document and reference the constant
Thanks, I am saving it in the artifact folder and the properties are like thisNow If I want to display that image how to do that?
I don't get it , you are asking for interface component to show a saved document or way handle generated document. If You are looking for Interface component you can use "Document Viewer field" or "image field ".
Want to know how to handle the generated document? Or Displaying the Generated Document into an interface.
If you don't want to save the document in DB , Design a process model like this
save the Generated document in a process variable (It stores Document ID)
Design a Interface with either documentviewer field or Image field
Call the interface In the user input task (Process model ) pass the generated qr
Thanks a ton. I have one more question related to this, Is it possible to call that Generate QR Code without defining a process model? Or Is it possible to call the process model on page load?
Process model is required , there is no function provided in that plugin. On Page load we can't start a process.For starting a process we need an interaction
Now i get what you wanted ,You want to generate and show QR code in a single interface isn't it? , Correct me if i'm wrong.
I would like to suggest small changes to above design. Design the main interafce like in below snippet.
{ a!cardLayout( contents: { a!documentViewerField( label: "Document Viewer", labelPosition: "ABOVE", document: ri!document, height: "MEDIUM", showWhen: a!isNotNullOrEmpty(ri!document) ), a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Generate QR code", style: "OUTLINE", showWhen: a!isNullOrEmpty(ri!document), saveInto: a!startProcess( processModel: "Your process model", onSuccess: a!save(ri!document,fv!processInfo.pv.generatedqr) ) ) }, align: "START", marginBelow: "NONE" ) }, height: "AUTO", style: "TRANSPARENT", marginBelow: "STANDARD" ) }
Yes, to some extent, in my case I will save the image in an Artifact folder, and from next time onwards I will check for the image if it is already generated then I will use the image and display it like above else I will generate a new one and display that, as you have done.
It is sophisticated, but it is possible to call a process model without user interaction on page load, e. g. :
local!docID: call_IntegrationObject (which calls a WebAPI), The WebAPI is calling the desired process model.
This executes the process model every time the UI is loaded.
It's too much of work and just like you said it's too sophisticated leads to performance issues