Hello
I have PowerApps where I'd like to just fill in data using text input fields, date picket and dropdown.
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
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.
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
It doesn't help, it creates empty lines/fields
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.
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 🙂
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)
WarrenBelz
146,653
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional