Solved! Go to Solution.
Hi @tsunatsuna ,
All the steps seemed perfect.
I suggest you to try in another list to check if it works. Or just delete your current custom form and re-create one. It can be deleted from List settting ➡ Form setting ➡ Delete custom form.
Best regards,
Sik
Hi @tsunatsuna ,
Which control do you want to display the control? Display Form?
If you want to click the file in form and open it, the Launch function can be useful to open the file online or in client apps.
However, the Attachment control in the Attachment Data Card is a standard control designed to add, remove, download the attachment files and have no OnSelect property to set. We just try to delete it, and add a list box instead in the data card.
1. set Items property of listbox as below to display all files
ThisItem.Attachments
2. set OnSelect property of listbox as below to open the files online.
Launch(ListBox1.Selected.AbsoluteUri & "?web=1")
3. To two errors, just delete Update property and set Y property properly.
If you want to open the file in client apps, just put 'ms-excel: ofe|u|' (for excel files), or put 'ms-word: ofe|u|' at the beginning of the link. So change OnSelect property of list box as below, then open excel/word files in client app, open other files online.
If(".xls" in ListBox1.Selected.DisplayName,Launch("ms-excel:ofe|u|"&ListBox1.Selected.AbsoluteUri),".doc" in ListBox1.Selected.DisplayName,Launch("ms-word:ofe|u|"&ListBox1.Selected.AbsoluteUri),Launch(ListBox1.Selected.AbsoluteUri & "?web=1"))
Hope this helps.
Best regards,
Sik
If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.
Hi @tsunatsuna ,
Do you mean if you set list box's Display Mode to View, you wouldn't open the files?
I think this is fine, View mode is only to display data, have no way for interaction.
To No,3, it is for opening files in client application, you just need to just put 'ms-excel: ofe|u|' (for excel files) before the AbsoluteUri of attachment. e.g. Launch("ms-excel:ofe|u|"&ListBox1.Selected.AbsoluteUri) .
Note: 'ms-excel: ofe|u|' is for excel , 'ms-word: ofe|u|' is for word.
If you still have any issue , please post back some screenshots and formula error information, to help you resolve it.
Best regards,
Sik
If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.
Thank you so much @v-siky-msft
I mean I would like to open the files in view mode. Because I click the list, it is view mode. In addition to this, I don't want to be edit mode, as I can't allow to edit list.
Hi @tsunatsuna ,
Do you mean the view mode of The Form?
Did you use EditForm? Actually, you can use Display Form, the other field would be in view mode, and attachment list box can still be selected. please see my demo.
Best regards,
Sik
Thank you for your quick replying @v-siky-msft
and sorry for my poor explanation.
Here are details:
・It's edit form.
・if Default mode is Edit, I can open file
・if Default mode is view, I can't open it. when I click edit all of list(attached picture2), I can open.
Hi @tsunatsuna ,
Yes, I know.
And I suggest you to use Display Form which would meet your requirement.
Best regards,
Sik
I see.
please tell me two things;
1.how to change viewform. an error occurs.(attached 12picture)
2.how to pass the data from list. I added field, but it seems it cant have the data.(attached 13picture)
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
4 | |
2 | |
2 | |
2 | |
2 |