Hi!
i created a cdt with an imageID then in an interface i designed a file upload with the target pointing to a documents folder and a save into and value of ri!product.imageId, now on an approval interface i want to display those images, i tried this: a!documentImage(todocument(tointeger(ri!product.imageId))).document but i get this as an error: Interface Definition: Expression evaluation error at function a!imageField [line 77]: An image gallery component [label="Item's Pictures"] has an invalid value for "images" at index 1. None of the values in "images" can be null.
Is it because i didnt save to the database yet or another problem?
Discussion posts and replies are publicly visible
First make sure the data flow in your process is correct. Validate this by opening the process instance in monitoring and check whether your process variables have the expected values.
I think that you can reduce your code to
a!documentImage(ri!product.imageId)
Appian will happily cast your data types to the target data type. Keep in mind, this works almost perfectly for assignments, not for comparisons.
As you can see in the imageId the data is passing throw after submiting the form, when i type a!documentImage( ri!product.imageId )
i get this error message now: Interface Definition: Expression evaluation error at function a!imageField [line 72]: The image at index 1 in an image gallery component [label="Item's Pictures"] has an invalid value for "document". "document" must not be null.
Do you pass the data into the user input task?
Seems like you configured the field in the CDT as an integer. Please change that to "Document". Appian will still persist the id to DB, but I think the rule input used to store uploaded document must be of type Document.
Changed it, i dont even get to the user input task (even though I already did it and values are being passed through) because I cant get the interface to work, i get the same error even with the imageId type changed to document
the same error in the interface*
What do you mean? In the interface designer? Make sure to show the image field only if there is an image to show. And/or provide some valid values for testing.
i designed a form where a user can add a item with pictures attached then a read only form where the validator can preview the items including the pictures then i built a process model where the user enters the items in the form then i click refresh go to the user input task to validate the item all the information is showed except the pictures because i keep getting into error when designing the validate form
"then i click refresh go to the user input task to validate the item all the information is showed except the pictures because i keep getting into error when designing the validate form"
What does "click refresh" mean?
So your problem is that you are not able to create the second form because of the error.
As I mentioned, you need to make sure that the image field only shows when there are some images. Then, designer is happy.
Thank you so much, managed to make it work, had to input some values in orther for the interface not to show error, thanks for the trouble