Display Default Image As Initial Value of Image Field

I am trying to set an InitialValue or Default Value for an image field (ProfilePic). Right now if there is no image specified it just shows a blank space. I would like for it to show a default profile image which I have created and stored on a DropBox drive.

I have seen the help article about using โ€œraw=1โ€ to get actual image from public DropBox URL.

I have tried using a LinkURL expression in InitialValue field as well as a SnapShot expression in InitialValue field.

Any other ideas?

Thanks.

0 11 2,808
  • UX
11 REPLIES 11

Steve
Platinum 4
Platinum 4

What is the URL youโ€™re trying to use?

Actually, due to complexities of trying to deal with Dropbox files I have now moved to just using an image stored in the same AppSheet folder as the associated data.

But even that doesnโ€™t seem to be working. Not sure what function/expression I should be using to reference that image.

If you picture file is in the exact same folder as the data then simply โ€œyourpicturetitle.pngโ€ in your Image column should work. You can also define it relatively โ€œsubfolder/yourpicturetitle.pngโ€.

I placed the name of the file in the InitialValue field. The expression evaluates OK but I still donโ€™t see the image in the ProfilePicture field when adding a new record.

I even tried making it a required field and it seemed to have something present there but now just shows an exclamation point !

See attached screen shots.

Have you looked at this?

Yes. I had already reviewed that document and video.

Since I am now storing the default image file in the same directory as my app. I believe I just need to specify the image name โ€œPracticionerDefaultImage.pngโ€ in the InitialValue field for the column. Please tell me if this approach is incorrect.

Although it is evaluating the expression as if it is correct. It still does not show the image as an InitialValue when I try to enter a new record.

Thanks for any assistance you can provide.

Please change the column type from Imageto Text. Does the (textual) initial value then occur for that column in the form for a new row?

Yes. It does show the Text Value of the image name. See attached ScreenShot.

Okay. You can return the column type to Image if you want.

Youโ€™re confident a file of that exact name exists in that images directory?

Thanks Steve.

I was able to resolve the problem. Went back and double-checked everything and the image file was actually in a subfolder called โ€œPracticioner_Imagesโ€. Adding this subfolder to the path fixed the problem.

Stupid error on my part. Sorry for spending some of your cycles. Still pretty new to the platform (i.e. less than a week).

Weโ€™ve all been there. Glad you found the problem!

Top Labels in this Space