web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collecting text input ...
Power Apps
Unanswered

Collecting text input fields from a gallery

(0) ShareShare
ReportReport
Posted on by 205

Hi everyone, 

 

I would like to save all the data that is entered in the text fields in a gallery into a collection on the click of a button which I am trying to achieve through this formula.

Collect(
 DataToPatch,
 ForAll(
 Gallery5.AllItems,
 {
 rowNum: Label20.Text,
 repNum: Label24_1.Text,
 department: Dropdown8.Selected.Dept,
 hod: Label37.Text,
 level: Radio5_1.Selected.Value
 // Add more fields as needed
 }
 )
);

However I am running into a problem whereby I am only saving the data of the current item in the gallery. I am not sure if it matters but all the text labels and dropdown boxes etc. are placed in a container within the gallery. Your help would be very much appreciated!

Categories:
I have the same question (0)
  • Verified answer
    AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @ccqn,

     

    You could use the OnChange property of the Text Input and Drop down control.

    Patch(Collection Name, ThisItem, {'Column Name': Self.Text})
    Patch(Collection Name, ThisItem, {'Column Name': Self.Selected.Value})

     

    And for your button OnSelect property:

    Patch(Table Name, Collection Name);

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • ccqn Profile Picture
    205 on at

    Hi @AARON_C ,

     

    Thank you that worked like a charm to patch to the collection. However now I have a problem where the value in my dropdown box disappears after I select it.

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @ccqn,

     

    Do you have the Default property of the Drop down set to: 

    ThisItem.'Column Name'

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • ccqn Profile Picture
    205 on at

    Hi @AARON_C ,

     

    Just changed it and it works now! But unfortunately I have ran into another problem..... I am currently using a vertical container with scrolling and upon choosing a field, the container keeps scrolling to the top by itself. Any ideas on how to deal with that...

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @ccqn,

     

    Can you provide some more detail or screen shots of your app? Does this gallery control need to be in a container?

     

    I am trying to replicate your issue, but I am getting it to work fine on my end I think. I have just placed a gallery control inside of a container.

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • ccqn Profile Picture
    205 on at

    Hi @AARON_C ,

     

    This is how my gallery is structured.

     Annotation 2023-09-29 104557.png

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @ccqn,

     

    Sorry, I am not too sure about the issue you are getting. My side seems to work fine, it does not move when I click on any of the input controls. I will keep looking into this to try and replicate it.

     

    Hopefully someone else knows the answer to this.

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • ccqn Profile Picture
    205 on at

    Hi @AARON_C ,

     

    Thank you so much for your help thus far. The autoscrolling only happens when I change the value of the input control, not when I am clicking on it.

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @ccqn,

     

    It could just be power apps being power apps. I have created the same structure gallery as you have and I am not having any issues.

     

    AARON_C_1-1695961308796.png

     

     

    Maybe try saving the app and opening it back up?

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard