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

Community site session details

Session Id : fekqC2O5BOmcyVKlThixw3
Power Apps - Building Power Apps
Unanswered

Send button using collection created additional lines

Like (0) ShareShare
ReportReport
Posted on 21 Dec 2023 10:33:20 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

  • v-qiaqi@microsoft.com Profile Picture
    on 21 Dec 2023 at 14:00:38
    Re: Send button using collection created additional lines

    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.

     

  • Matt78 Profile Picture
    on 21 Dec 2023 at 13:47:47
    Re: Send button using collection created additional lines

    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
    on 21 Dec 2023 at 13:36:17
    Re: Send button using collection created additional lines

    Hi @Matt78,

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

    vqiaqimsft_0-1703165629401.pngvqiaqimsft_1-1703165688202.png

     

  • Matt78 Profile Picture
    on 21 Dec 2023 at 13:24:52
    Re: Send button using collection created additional lines

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

  • v-qiaqi@microsoft.com Profile Picture
    on 21 Dec 2023 at 13:09:14
    Re: Send button using collection created additional lines

    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 21 Dec 2023 at 12:58:19
    Re: Send button using collection created additional lines

    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
    on 21 Dec 2023 at 12:50:34
    Re: Send button using collection created additional lines

    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)
    
     

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete