cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

show rows

Hello Team,

 

I am little stuck in between, here i need to know it this is possible. I am looking to expose a button as "Add new item" when i click on the button the function is working fine, but what i need is when i click on the button it displays multiple rows. Perhaps i need to get one row at a time.

 

What is the best way to approch, because i am running of ideas?

 

Capture28.PNG

 

Thanks in advance and appreciated !

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: show rows

Yes pretty much exactly, but just one additional. The form won't be blank it will start with one row after if required I will click on Add new item then second row will appear and so on.

View solution in original post

Highlighted
Microsoft
Microsoft

Re: show rows

I think a Gallery control would be more suitable for that. I just created a sample prototype. Try this:

1. Create a new app

2. Add a new Blank Vertical Gallery control

3. Add a Button (this is your "Add New Item" button)

4. Select the button and set Button1.OnSelect=Collect(t, {f1:"",f2:["1","2","3","4"],f3:""})

5. Select the Screen and set Screen1.OnStart=Collect(t, {f1:"",f2:["1","2","3","4"],f3:""})

6. Set Gallery1.Items=t

7. Add 2 TextInput controls and one DropDown control to your gallery. Set TextInpujt1.Default=ThisItem.f1, DropDown1.Items=ThisItem.f2, TextInput2.Default=ThisItem.f3

 

Now, if you preview your application, you will be able to click on the button and add rows to your gallery. In a real application, you will have to pull data from a source into your dropdown. Also, note the item #5 above. This will add a row automatically on application start.

Later, you will have to use "Patch" function in order to save your data (when the Save button is clicked).

 

Hope this helps.

View solution in original post

Highlighted
Super User
Super User

Re: show rows

Check out my video on Repeating Tables in PowerApps. I show you how to do all of this and more. 🙂 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

8 REPLIES 8
Highlighted
Microsoft
Microsoft

Re: show rows

Just to clarify, you would like to be able to add multiple rows at a time. If os then please see the "Patch" function: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

Highlighted
Resolver II
Resolver II

Re: show rows

I meant like , when I click on "Add new item" first row should display for the first time. When I click on second time on "Add new item" second row should display.
Highlighted
Microsoft
Microsoft

Re: show rows

Sorry. I'm not sure I understand it. Let me try to explain what I understood. You start with an empty screen, on which you have "Add new Item" button. You click on it and that adds a single row to your gallery. You click it again and that adds another row and so on. Finally, you click Save after which all the items are saved to your data source. Is this correct? 

 

Highlighted
Resolver II
Resolver II

Re: show rows

Yes pretty much exactly, but just one additional. The form won't be blank it will start with one row after if required I will click on Add new item then second row will appear and so on.

View solution in original post

Highlighted
Microsoft
Microsoft

Re: show rows

I think a Gallery control would be more suitable for that. I just created a sample prototype. Try this:

1. Create a new app

2. Add a new Blank Vertical Gallery control

3. Add a Button (this is your "Add New Item" button)

4. Select the button and set Button1.OnSelect=Collect(t, {f1:"",f2:["1","2","3","4"],f3:""})

5. Select the Screen and set Screen1.OnStart=Collect(t, {f1:"",f2:["1","2","3","4"],f3:""})

6. Set Gallery1.Items=t

7. Add 2 TextInput controls and one DropDown control to your gallery. Set TextInpujt1.Default=ThisItem.f1, DropDown1.Items=ThisItem.f2, TextInput2.Default=ThisItem.f3

 

Now, if you preview your application, you will be able to click on the button and add rows to your gallery. In a real application, you will have to pull data from a source into your dropdown. Also, note the item #5 above. This will add a row automatically on application start.

Later, you will have to use "Patch" function in order to save your data (when the Save button is clicked).

 

Hope this helps.

View solution in original post

Highlighted
Super User
Super User

Re: show rows

Check out my video on Repeating Tables in PowerApps. I show you how to do all of this and more. 🙂 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

Highlighted
Resolver II
Resolver II

Re: show rows

Hello Team,

 

Thank you for the solution, well this is the exact solution i was looking for.

 

Appreciated !

 

Thanks and Regards,

Nikhil.

Highlighted
Resolver II
Resolver II

Re: show rows

Hello,

 

Thank you for the input, but i am little in between with the below 

 

I have synchronized both the inputs , but now the problem here is.

 

1. When i click on Add new item or button new row will be added but with the same first value entered.

2. Rows are not cleared when i click on button its added new row with old values, when i click on button new row with empty boxes should be avaliable.

3. I have used this code in the button, but i have found there something missing perhaps i couldnt find out what is missing Patch(ProjectC,{Name:TextInput2.Text,Actual:Value(TextInput3.Text),Cost:dropdown2.Selected.Value});Collect(ProjectC, {Name:"",Actual:"",Cost:""})

 

If i use like this Patch(ProjectC,First(ProjectC),{Name:TextInput2.Text,Actual:Value(TextInput3.Text),Cost:dropdown2.Selected.Value});Collect(ProjectC, {Name:"",Actual:"",Cost:""}) with the highlighted one it will add new row with no values, if i remove and press the button " The Data source supplied to the function is invalid".

 

4. If i use First() the values from the second row are replacing to first row.

 

Well if you could help me on this one, would be appreciated!

 

Thanks and Regards,

Nikhil

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,844)