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 Apps
Answered

Show rows+

(0) ShareShare
ReportReport
Posted on by 522

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

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    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

  • Nikhil2 Profile Picture
    522 on at

    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/135909#M47019

     

    Thanks and Regards,

    Nikhil

     

    Thanks and Regards,

    Nikhil

  • Verified answer
    Shanescows Profile Picture
    2,218 Most Valuable Professional on at

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

  • Nikhil2 Profile Picture
    522 on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard