Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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

  • v-qiaqi@microsoft.com Profile Picture
    on at
    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 at
    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 at
    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 at
    Re: Send button using collection created additional lines

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

  • v-qiaqi@microsoft.com Profile Picture
    on at
    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 at
    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 at
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,653 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard