Hi Thanks for the respons, i actually managed to get it write after hours of online time and Youtube, below is the code i used and the link to the Video
https://youtu.be/npvAQLZaG1c
@ShaneYoung @RezaDorrani not sure if they could make this better, but it did help me out alot.
//Prepair Sub-Gallery Attachements to be uploaded to SP List
Ungroup(
ForAll(
ListOfBiidersSelected.AllItems,
ForAll(
RFQDocumnt.AllItems,
Collect(
VImage1,
{Value: ThisRecord.Value}
);
Collect(
dataCollection,
{
Name: ThisRecord.Name,
base64: With(
{
varDemoFromAttachmentControl: JSON(
Image4.Image,
JSONFormat.IncludeBinaryData
)
},
Mid(
varDemoFromAttachmentControl,
Find(
",",
varDemoFromAttachmentControl
) + 1,
Len(varDemoFromAttachmentControl) - Find(
",",
varDemoFromAttachmentControl
) - 1
)
)
}
)
);
//Patch Bidder Information
Patch(
'List_of_Bidders new test',
Defaults('List_of_Bidders new test'),
{
Title: title,
ReceivedFrom: ComboBox1.Selected.DisplayName,
company: company,
email: emails,
BU: "BU" & Mid(
title,
4,
3
),
Discipline: discipline,
DueDate: duedate,
ServiceType: "Sub-Contractor",
ProjectName: txtProjectName.Text,
EDSNextProjectNumber: txtProjectNumber.Text
}
);
Refresh('List_of_Bidders new test');
//Create Collection for Flow Upload of attachments
Collect(
BigCollection,
{
ID: First(
Sort(
'List_of_Bidders new test',
ID,
SortOrder.Descending
)
).ID,
AttCollect: dataCollection
}
);
'PowerApp->Compose'.Run(
JSON(
BigCollection,
JSONFormat.IndentFour
)
);
RemoveIf(
BigCollection,
true
);
RemoveIf(
dataCollection,
true
)
),
"Value"
);