
Announcements
I want to build something as follow inside my Power Apps:-
where user do the following:-
1) Enter a string representing the designs separated by ",".
2) based on the number of designs (3 in the above example) >> to show Upload files controls inside a gallery
3) where users can upload a file and chose its Design from a combbox based on the values entered inside the text field (Desgins).
4) then the user clicks on submit >> which should submit the text field to a SharePoint list and the 3 attachment files to a SharePoint library.
Of course users can enter many designs and not limited to 3, where i need this to dynamically allow to upload files. is this possible inside Power apps? also i need this to work for new & edit scenarios, where users can access the screen and edit the designs attachments or upload new ones.. can anyone help? i know how to upload files from power apps to SharePoint using power automate, my question is how i can handle the attachments and their metadata and pass them to power automate for new and edit scenarios?
Thanks in advance for any help.
I have something similar in use that I think maybe what you are looking for? I have a Multi Photo Upload screen, setup like this
Steps:
1. Users add attachments/photos in the lefthand attachment control
2. the OnAddFile of the control adds new files to a collection
3. the OnRemoveFile removes files from the collection
4. User then adds text/metadata per file to be uploaded with the attachment
5. Save Files creates files in DocLib and adds metadata to the DocLib related to the new file
(note: this is my exact code, you'll need to adjust to suit)
OnAddFile code
// Note: my attachment control is called fileUploads
ForAll(
fileUploads.Attachments As _files,
If(
CountRows(
Filter(colFileUploads, Name = _files.Name)
) = 0,
Collect(
colFileUploads,
AddColumns(
Table(_files),
"togBeforeAfter", "",
"photoNotes", ""
)
)
)
);
OnRemoveFile code
ClearCollect( colFilesTemp, colFileUploads);
ForAll(
colFilesTemp As _records,
If(
Not(_records.Name in fileUploads.Attachments.Name),
RemoveIf( colFileUploads, Name = _records.Name)
)
)
Gallery on the right Items
colFileUploads
Save Files button code
ForAll(
Ungroup(
ForAll(
Sequence(CountRows(fileUploads.Attachments)),
{
myRecord: Table(Last(FirstN(fileUploads.Attachments,Value))),
RowNumber: Value
}
),
"myRecord"
) As _uploads,
ProjectMulti_PhotoUpload.Run(
gblCPRecord.Project,
gblSite,
User().FullName,
LookUp(colFileUploads, Name = _uploads.Name, photoNotes),
"Southern",
"Completion",
gblSite & "_" & Text( Now(), "[$-en-US]yymmdd-hhmmss" ) & "_" & _uploads.RowNumber & ".jpg",
{
file:
{
contentBytes: _uploads.Value,
name: _uploads.Name
}
}
)
);
// clear attachments, refresh ProjectPhotos, navigate back
Select(icClearImages); Refresh(ProjectPhotos); Back();
icClearImages code
Clear(colFileUploads);Reset(fileUploads)
My Flow, it has 2 branches but just showing one
For the Save Files code, I referenced Chino Does Stuff video, here
https://www.youtube.com/watch?v=yC0W5am6M3Q&t=1182s
Not 100% sure if this is what you are looking for but may give you some ideas?