web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch Function for a G...
Power Apps
Unanswered

Patch Function for a Gallery

(0) ShareShare
ReportReport
Posted on by

Hi I have a form in my PowerApps screen and a Gallery! 

Danny_Dicaprio_0-1702393425605.png

 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

        }

    )

);
Categories:
I have the same question (0)
  • scalca Profile Picture
    on at

    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

  • Danny_Dicaprio Profile Picture
    on at

    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 ?

     

  • scalca Profile Picture
    on at

    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 ? 

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard