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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard