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 Platform Community / Forums / Power Apps / Value only saves to co...
Power Apps
Answered

Value only saves to collection if I add row

(1) ShareShare
ReportReport
Posted on by 23
Hi, 
 
I'm not quite sure how to fix this...
 
I have a gallery(galphyUmg) with one text field that my user will fill with an action. The Items on my gallery(galphyUmg) is set to my collection (colActionphyUmg)
 
 
I have an add row button with the following in OnSelect: 
Patch(colActionphyUmg;ThisItem;{physischeUmgebung:txtphyUmg.Text});;
Collect(colActionphyUmg; {physischeUmgebung:""});;
 
I have a save button which patches it to my sharepoint list HFIX, with the following in OnSelect
ForAll(galphyUmg.AllItems;Patch(HFIX;Defaults(HFIX);{physischeUmgebung:txtphyUmg.Text}));;
Notify("Action successfully saved";NotificationType.Success;4000);;
Refresh(HFIX);;
 
I've noticed it only saves to my collection if I add another row. If I do this then the value plus the blank row gets saved to my sharepoint list. 
 
How can I add just one value to my colection without having to add another row?
 
Thanks for any help, it's appreciated!
 
 
 
 
 
 
 
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at
    Try patching the collection and filtering out the blank line
    Patch(
       HFIX;
       ForAll(
          Filter(	
             colActionphyUmg;
             Len(physischeUmgebung) > 0
          ) As _Data;
          {physischeUmgebung: _Data.txtphyUmg.Text}
       )
    );;
    Notify(
       "Action successfully saved";
       NotificationType.Success;
       4000
    );;
    Refresh(HFIX);;
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
     
     
  • CU27091340-1 Profile Picture
    23 on at
    Hi @WarrenBelz
     
    Thanks so much for your reply. 
     
    I tried it out and it worked. Only my value was saved in my shrepoint list. In my collection, it saved my value and the blank row.  Thank you thank you!
     
    Is there a way around not having to add a row, so that it gets patched to the collection and sharepoint list? Or if there is no way around having to add a row, can this be done automatically? I can imagine that the users would forget to add a row and then they would press save thinking it has been saved.
     
    Thank you!
     
     
  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at
    The code I supplied should filter out any blank row and there is no reason it should not save if a blank row is not added.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard