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 / Send button using coll...
Power Apps
Unanswered

Send button using collection created additional lines

(0) ShareShare
ReportReport
Posted on by

Hello

 

I have PowerApps where I'd like to just fill in data using text input fields, date picket and dropdown.

 

Matt78_0-1703154639281.png

I have a "send" button where I have this formula and for some reason it creates additional empty lines. How should I correct my formula so I can just collect data I have filled and no additional empty lines would be created.

 

ForAll(
Gallery1.AllItems;
Collect(colMyGallery;

{
DatePicker1: DatePicker1.SelectedDate;
TextInput4: TextInput4.Text;
Dropdown1: Dropdown1.Selected;
TextInput1: TextInput1.Text;
TextInput3: TextInput3.Text;
TextInput2: TextInput2.Text
}
)
);;
Navigate(Screen3; ScreenTransition.Fade)

 

 

br

Matt

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Matt78,

    The formula you provide does patch all the items from the Gallery including empty lines to you task data source, if you want to avoid patching empty records, you need to use a primary key to check if a record is empty or not.

     

    Assuming there is a TextInput control to define the primary key in your Gallery, before patching, you just need to filter the items that with the primary key not blank:

    ForAll(
    Filter(Gallery1.AllItems;!IsBlank(TextInput_Primary_Key.Text));
    Collect(colMyGallery;
    
    {
    DatePicker1: DatePicker1.SelectedDate;
    TextInput4: TextInput4.Text;
    Dropdown1: Dropdown1.Selected;
    TextInput1: TextInput1.Text;
    TextInput3: TextInput3.Text;
    TextInput2: TextInput2.Text
    }
    )
    );;
    Navigate(Screen3; ScreenTransition.Fade)
    
     
  • Matt78 Profile Picture
    on at

    I don't have empty lines. I fill data fields and when I push send, it creates empty lines out of nowhere. This started as simple PowerApp, all I wanted was to have 6 data fields where users could fill in data if there are some changes in our products. Then this data could be sent via email forward. It's been 4 months and so far no one has been able to solve how to create this 🙂

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Matt78,

    Okay, I think I know what's wrong with the formula:

    ForAll(
    Gallery1.AllItems;
    Collect(colMyGallery;
    {
    Field_of_DatePicker1: DatePicker1.SelectedDate;
    Field_of_TextInput4: TextInput4.Text;
    Field_of_Dropdown1: Dropdown1.Selected;
    Field_of_TextInput1: TextInput1.Text;
    Field_of_TextInput3: TextInput3.Text;
    Field_of_TextInput2: TextInput2.Text
    }
    )
    );;
    Navigate(Screen3; ScreenTransition.Fade)

    Remember to specify a field for each control in your Gallery, like there must be a Date field saving the DatePicker1 selected date, whatever you rename it, you need to specify it in your Collect() function.

  • Matt78 Profile Picture
    on at

    It doesn't help, it creates empty lines/fields

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Matt78,

    I have tested on my side, and it works as below:

    vqiaqimsft_0-1703165629401.pngvqiaqimsft_1-1703165688202.png

     

  • Matt78 Profile Picture
    on at

    Matt78_0-1703166356829.pngMatt78_1-1703166370918.pngMatt78_2-1703166378046.png

    I just want to fill in data fields and send the collected datas via email.. now it won't collect and keeps adding empty fields, or in some cases it copies the first filled data row

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Matt78,

    To be honest, I am not sure how you write the ForAll() function on your side, I need a screenshot of the formula bar in your canvas app.

     

    I just saw the result of your testing result, not the process how you write your formula.

    To collect records from a Gallery is easy, however, however, some details that you didn't explain and that I don't know hindered your success.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 516

#2
WarrenBelz Profile Picture

WarrenBelz 428 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 292

Last 30 days Overall leaderboard