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

Patching table in Variable

(0) ShareShare
ReportReport
Posted on by 101

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
    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
    101 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

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