Hello, I'm creating an user dashboard, and having some difficulties with a code lineIn this dashboard, i show some data from the user, and a profile picture that is already loaded in our files, The problem is, when an user doesnt have a profile picture to be retrieved, the code doesnt work because the field "document" must not be null. I tried using an "If" statement to solve it, but the error keep showing. This is the code that im using:
*For context only*
local!data.id_fotoperfil=Profile picture Id
cons!ImagenDePerfilPorDefault= default profile picture
Code:
a!sideBySideItem( item: a!imageField( labelPosition: "COLLAPSED", images: { a!documentImage( document: if(isnull(local!data.id_fotoperfil), cons!ImagenDePerfilPorDefault, local!data.id_fotoperfil)) }, size: "MEDIUM", isThumbnail: false, style: "AVATAR" ), width: "MINIMIZE"
Discussion posts and replies are publicly visible
Hi (hola) AngelV
If the image is from an Appian user, try using the component: a!userImage(). if the user does not have an image, a default is displayed
Example:
Regards
Gustavo
I actually tried this and it worked, thank you very much.