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

Show rows+

Hello,

 

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

 

https://powerusers.microsoft.com/t5/General-Discussion/show-rows/m-p/129787#M45286

 

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. Or if i use like this it will patch only last record.

 

What i need, Click on add new item new blank rows gets added and input values on second row and so on. i need to collect all the items from the gallery. Not only last record or first record.

 

ForAll(Gallery1.AllItems,Patch(ProjectC,{Name:Name},{Name:TextInput2.Text,Actual:Value(TextInput3.Text),Cost:Dropdown2.Selected.Value});Collect(ProjectC, {Name:"",Actual:"",Cost:""}))

 

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

 

Thanks and Regards,

Nikhil

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Re: Show rows+

Hi @Nikhil2,

 

Could you please share a bit more about your scenario?

 

For your first question, could you please share mode details about the formula within the OnSelect property of the "Add new item" button?

 

For your second question, could you please a bit more about the formual within the Button control?

 

For you third question, could you please share a bit more about the ProjectC that you mentioned? If you want add new record into your ProjectC data source using Patch function, please take a try with the following formula:

Patch(ProjectC,Defaults(ProjectC),{Name:TextInput2.Text,Actual:Value(TextInput3.Text),Cost:dropdown2.Selected.Value})

For your forth question, do you want to save all items within your Gallery control into the ProjectC data source?  Please take a try with the following workaround:

 

Set the Items property of the Gallery control to following formula:

AllRecords

Set the OnSelect property of the "Add new row"  button to following formula:

Collect(
AllRecords,
Patch(
ProjectC,
First(ProjectC),
{
Name:TextInput1.Text,
Actual:Value(TextInput2.Text),
Cost:Dropdown1.Selected.Value
}
)
)

Set the OnSelect property of the "Save" button to following formula:

Remove(ProjectC,First(ProjectC));
ForAll(
Gallery1.AllItems,
Patch(
ProjectC,
Defaults(ProjectC),
{
Name:Name,
Actual:Actual,
Cost:Cost
}
)

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Super User
Super User

Re: Show rows+

Give this video a watch. I do exactly what you are talking about and show it all working. PowerApps Repeating Tables

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

4 REPLIES 4
Community Support
Community Support

Re: Show rows+

Hi @Nikhil2,

 

Could you please share a bit more about your scenario?

 

For your first question, could you please share mode details about the formula within the OnSelect property of the "Add new item" button?

 

For your second question, could you please a bit more about the formual within the Button control?

 

For you third question, could you please share a bit more about the ProjectC that you mentioned? If you want add new record into your ProjectC data source using Patch function, please take a try with the following formula:

Patch(ProjectC,Defaults(ProjectC),{Name:TextInput2.Text,Actual:Value(TextInput3.Text),Cost:dropdown2.Selected.Value})

For your forth question, do you want to save all items within your Gallery control into the ProjectC data source?  Please take a try with the following workaround:

 

Set the Items property of the Gallery control to following formula:

AllRecords

Set the OnSelect property of the "Add new row"  button to following formula:

Collect(
AllRecords,
Patch(
ProjectC,
First(ProjectC),
{
Name:TextInput1.Text,
Actual:Value(TextInput2.Text),
Cost:Dropdown1.Selected.Value
}
)
)

Set the OnSelect property of the "Save" button to following formula:

Remove(ProjectC,First(ProjectC));
ForAll(
Gallery1.AllItems,
Patch(
ProjectC,
Defaults(ProjectC),
{
Name:Name,
Actual:Actual,
Cost:Cost
}
)

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Nikhil2 Resolver II
Resolver II

Re: Show rows+

Hello Kris,

 

Greeting for the day and Thank you for the reply.

 

Before press on button user will enter the values to the first row, if required user will press on button for the second entry.

 

1. What happens when user click on button(Add new item)-> it adds a new row to the gallery after that when user enter values inside the second row, instead of holding the values inside the second row its pushing the values to the first row and overlapping the first row values from second row values.

 

2.  For second question i am using this formula for the button, problem it is not adding the second row with empty boxes or empty row it contains the values from the first row.

 

ForAll(Gallery1.AllItems,Patch(ProjectC,{Name:TextInput2.Text,Actual:Value(TextInput3.Text),Cost:Dropdown2.Selected.Value});Collect(ProjectC, {Name:"",Actual:"",Cost:""}))

 

3. ProjectC i am pushing the values to the ProjectC after when i click on save it should patch the values from the collection to sharepoint.

 

And this one of the interesting question which i have tweeted earlier this week, which is off the topic but if you could help with this it would be amazing.

 

Remember that earlier this week you had helped with the download multiple files formula, guess what it had worked. Perhaps it would be most interesting if is possible to dowload the files in the Win Zip or Zip file(multiple files)

 

https://powerusers.microsoft.com/t5/General-Discussion/Download-multiple-flies-from-gallery/m-p/1359...

 

Thanks and Regards,

Nikhil

 

Thanks and Regards,

Nikhil

Super User
Super User

Re: Show rows+

Give this video a watch. I do exactly what you are talking about and show it all working. PowerApps Repeating Tables

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 Resolver II
Resolver II

Re: Show rows+

Hi Shane,

 

I have just followed your steps with little bit of addittion codes, guess what ? It did work for me. Thank you.

 

But i have one important thing in my app if you just look at this issue, it would be great.

 

 if is possible to dowload the files in the Win Zip or Zip file(multiple files) .

 

I have followed(below link from Kris) the download option by selecting checkbox for multiple files, but my concern is i need to download the files in ZIP files(Selecting 5 files and downloading in Zip mode). Current scenario is its downloading the files one after the other.

 

https://powerusers.microsoft.com/t5/General-Discussion/Download-multiple-flies-from-gallery/m-p/1359...

 

Thanks and Regards,

Nikhil

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,946)