Announcements
Hi @CU04011210-0
Let's utilize the DisplayMode property, every control in Power Apps has a DisplayMode property. You can leverage this to switch between View and Edit.
DisplayMode
For your Attachment control:
DisplayMode = If(FormMode = FormMode.View, DisplayMode.View, DisplayMode.Edit)
Set the Attachments control to inherit the form’s mode.
check also the Sources if more info needed:
Best regards, Valantis
✅ If this helped solve your issue, please Accept as Solution so others can find it quickly. ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :). 🏷️ For follow-ups @Valantis. 📝 https://valantisond365.com/
I think you should use two controls and toggle DisplayMode for this. Canvas Attachment control cannot show existing files in View mode while allowing new uploads in the same control, so the according to me the pattern should be like:
View Mode → Existing attachments shown in gallery. Edit Mode → Attachment control enabled for uploading new files.
DisplayMode = If(varFormMode="View", DisplayMode.Disabled, DisplayMode.Edit)
Gallery to show uploaded files Items = ThisItem.Attachments Visible = varFormMode="View"
Items = ThisItem.Attachments Visible = varFormMode="View"
Reference: Attachment control limitations(https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-attachments)
I hope this works for you!
If the Attachment control is already inside the form, you usually don’t need to add any condition for View or Edit mode because it automatically follows the form mode.
If the goal is to separate already uploaded attachments from new ones in Edit mode, one simple approach is to show the existing attachments in a Gallery inside the same DataCard so users can easily view them, and keep the Attachment control for uploading new files.
Add attachment control inside the Attachment DataCard.
Attachment Control Items Property:
Parent.Default
Gallery Item Property:
ThisItem.Attachments
Gallery Visible Condition: (On Visible Property)
ThisItem.'Has attachments'
Gallery Hight Property:
Self.AllItemsCount*Self.TemplateHeight
This makes it clearer for users because they can see the previously uploaded files separately and still use the attachment control to add new ones.
📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.
✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.
💛 A Like always motivates me to keep contributing!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 424
WarrenBelz 355 Most Valuable Professional
11manish 290