cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nikhil2
Level 8

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
Nikhil2
Level 8

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

Microsoft dinusc
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

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
Microsoft dinusc
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

Nikhil2
Level 8

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.
Microsoft dinusc
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? 

 

Nikhil2
Level 8

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

Microsoft dinusc
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

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

Nikhil2
Level 8

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.

Nikhil2
Level 8

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,434)