Hi I have a form in my PowerApps screen and a Gallery!
on the onselect of my Add button I have added following and my gallery items is My collection
Collect( MyCollection, { Skill: DataCardValue39.Text, // Assuming DataCardValue39 is a text input control ProficiencyLevel: DataCardValue36.Selected.Value, ExperienceLevel: DataCardValue38.Selected.Value } );
Gallery Lable controls are Label6_3 :Text Property ThisItem.Skill same for the following
what Iam really looking is I want record these collection as new record in my Data Source , ( Each skill should be a new record )
but Iam unable to do it , tried using the following patch function which is not working properly
Could Anyone please help me to fix it
ForAll(
MyCollection,
Patch(
'New tables',
Defaults('New tables'),
{
'Emp ID': DataCardValue20_1.Text,
'Employee Name': DataCardValue25_1.Text,
'Official Email ID ': DataCardValue27_1.Text,
Skills: Label6_3.Text,
'Proficency Level': Label6_4.Text,
'Expereince ': Label6_5.Text
}
)
);
what kind of errors ?
what about the other 3 fields Emp ID, Employee Name, Email Id ?
can you specify a little bit more what your goal is ?
so are u suggesting me to change the formula into following ?
ForAll(
MyCollection As ColRecord,
Patch(
'New tables',
Defaults('New tables'),
{
'Emp ID': DataCardValue1.Text,
'Employee Name': DataCardValue6.Text,
'Official Email ID ':DataCardValue7.Text
Skills: ColRecord.Skill,
'Proficiency Level': ColRecord.ProficiencyLevel,
'Expereince ':ColRecord.ExperienceLevel
}
)
);
Clear(MyCollection);
this formula is also showing some error and could u help me with it ?
try using As function in ForAll
ForAll(MyCollection As ColRecord ....
and then when you're patching do
Skills: ColRecord.Skill
Proficiency Level: ColRecord.ProficiencyLevel
looping through the collection and using values of it
in your code you are referencing controls instead of collection values
hope this helps
WarrenBelz
146,552
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional