
Announcements
Hi Every one ,
I have a skill app which looks like fllowing
when he clicks on the add button those details get displayed into my gallery (For Gallery Iam only displaying the attachment's name)
on Add button I have set the following formula
Collect(
MySkills,
{
Skill: DataCardValue5.Value,
ProficiencyLevel: DataCardValue6.Value,
ExperienceLevel: DataCardValue7.Selected.Value,
Attachment:DataCardValue18.Attachments
}
);
Reset(DataCardValue5);
Reset(DataCardValue6);
Reset(DataCardValue7);
On select of my button in my app, Iam patching this as new record in my SharePoint list.
ForAll(
MySkills As ColRecord,
Patch(
Skill_employee,
Defaults(Skill_employee),
{
EmployeeName: DataCardValue8.Value,
EmployeeID: DataCardValue17.Value,
Title: ColRecord.Skill,
Proficiency_level: { Value: ColRecord.ProficiencyLevel },
Years_of_experience: Value(ColRecord.ExperienceLevel) // Convert to Number
}
)
)
;
Clear(MySkills);SubmitForm(Form1); Notify("Form has been submitted successfully");
ResetForm(Form1);ResetForm(Form1_1);
Navigate('Employee Details Screen',ScreenTransition.Fade)
In the above formula I need to patch my attachment's also into my SharePoint List , I tried making changes to the formula but it is getting errros
Could anyone please help me on this
Hi @Danny_Dicaprio ,
Unfortunately the only way to add attachments directly from Power Apps to SharePoint is using an attachment control, either using SubmitForm or Patch(FormName.Attachments). This is due to the format that the attachment control stores the file, which needs the control itself to convert for filing in both format and location. The value you receive in your collection will not work.
Technically you can collect just the attachments and use this as the Items of an attachment control in a Form and Patch that as Updates, but this will only work for one record at a time and in your case does not achieve anything as you have the files in the control in the first place.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps