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 / Patching table in Vari...
Power Apps
Answered

Patching table in Variable

(0) ShareShare
ReportReport
Posted on by 102

Hello i m building my own component in powerapps, since i cannot use in components "collect" command i have decided to try placing table in to variable like this: 

Set(Var_LOV,Table({ID:1,Text:""},{ID:2,Text:""}))

 

afther that i tried to Patch this table like this: 

Ondrix_0-1666176407392.png


Is it possible to add empty row to table in variable like in collection?

Or is there some work around? I want just to press button and with each press of button to add a new row in to that table.

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Ondrix ,

     

    Do you want to use the app's collection in the component?

    If my assumption is correct, please turn on the " Collection assess in component scope" Setting.

    After enabling it, please save and restart the app to use it.

    vxiaochenmsft_0-1666258736704.png

    Once enabled, create a collection in the app.

     

    ClearCollect(CollectX,{ID:"1",Text:""},{ID:"2",Text:""})

     

    vxiaochenmsft_1-1666258767626.png

     

    vxiaochenmsft_2-1666258776023.png

     

    Add a Button in the component and set 'OnSelect' attribute to the following formula:

     

    Set(N,N+1);Patch(CollectX,Defaults(CollectX),{ID:2+N,Text:""})

     

     

    vxiaochenmsft_3-1666258830221.png

    vxiaochenmsft_4-1666258838838.png

     

    Best Regards,

    Wearsky

  • Ondrix Profile Picture
    102 on at

    Thank you, now i understand better that collection cant be inside of component as its part because it is still part of app not component, but i can reach to that collection from component and change that collection in app from that component. It makes sense its retired feature it behaves differently than with variables.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard