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 / Save items inside gall...
Power Apps
Answered

Save items inside gallery when row added

(0) ShareShare
ReportReport
Posted on by 242

I feel like there is an obvious way to do what I'm doing - so figured it was best to ask the experts.

I've broken this problem down to where buttons show the variable names.

JeckGill_0-1695629563182.png

the length of the gallery is specified by varTestSequence - when +1 or -1 is pressed (you guessed it), a row gets added or deleted. My problem arises when I have data already inside the gallery.

JeckGill_1-1695629637416.png

here's text in the gallery, then I press -1

JeckGill_2-1695629664821.png

 

is there a way to have it so that the textboxes/rows that have data inside remain? I think it'd get frustrating for my users when they had a last minute addition and have to type everything out again 😅

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @JeckGill ,

     

    Could you please tell what data source is the Gallery, in its Items property?

     

    Best regards,

  • JeckGill Profile Picture
    242 on at

    Sequence(_varTestSequence)

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @JeckGill ,

     

    So, every time you change the variable, the Gallery generates all items from blank. To achieve your need, please follow below steps:

    1. On set variable button:

    UpdateContext({_varTestSequence:5});ClearCollect(colG,Sequence(_varTestSequence))

    2. On +1 button:

    Collect(colG,{Value:Last(colG).Value+1})

    3. On -1 button:

    RemoveIf(colG,Value =LookUp(Gallery.AllItems,IsBlank(TextInput1.Text)).Value)

    4. Items of Gallery:

    colG

     

    Best regards,

  • JeckGill Profile Picture
    242 on at

    Everything except the -1 button is working - there's no error messages or red underlines too which is making this frustrating to figure it out 

  • JeckGill Profile Picture
    242 on at

    ah - disregard last reply; one of those mornings. Just missed a name change 😅

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard