I am building a simple expense tracker. As part of the expense entry form, I have a field for uploading a receipt. I currently have the field set to use an image datatype. But I would like the field to also allow the user to choose a non image file instead if the receipt is in pdf format. From reading the documentation, it seemed that this would only work if I seperated them into 2 fields. โฆone for images and one for files. From a user experience, this is less than ideal. Any suggestions? Thanks in advance.
Hello @leisterbrau, you could add an auxiliary enum field in your data source to use as a button for choosing the type of the file to upload, the options being โPDFโ or โImageโ, then using the show_if() parameters in your image and file columns you can insert an expression that would only show the one that is currently selected, for example:
For your show_ifs() for your PDF and Image columns respectively:
[enumColumn]="PDF"
[enumColumn]="Image"
For your editable_if() in your [enumColumn]
AND(ISBLANK([fileColumn]),ISBLANK([imageColumn]))
This last one is to avoid the possibility that an user, for example, selects the โPDFโ type, uploads a file in its respective column, then switches to โImageโ and does the same, as soon as they upload a file or image they wonโt be able to change the type, unless they erase it from the form.
User | Count |
---|---|
35 | |
30 | |
30 | |
20 | |
18 |