cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Collect syntax

Hi all,

 

I'm struggling to use the collect function to group my data in one place. I have one datepicker, one combobox, one dropdown and a text input and when trying to collect i have a button with this command on 'OnSelect':

Collect(Info, {"Date": DatePicker1.SelectedDate, "Book" : ComboBox3.SelectedItems, 
"Sheet" : Dropdown1.Selected, "Text" :TextInput1.Text})

However it isn't working - what am I doing wrong?

 

By the way, i'm doing this in order to export this to excel using flows - do you think this is wise/the best way to do it?

 

Kindest regards,

Colleen

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Collect syntax

Hi @Anonymous,

 

I think there is something wrong with the formula that you provided. Please take a try to modify your formula as below:

Collect(Info, 
{
Date:DatePicker1.SelectedDate,
Book:ComboBox3.SelectedItems, Sheet:Dropdown1.Selected,
Text:TextInput1.Text
}
)

 

For your second question, I agree with @Shanescows's thought almost. You could consider add your the Excel table of your Excel file as a data source within your app, then save your data (using SubmitForm function or Patch function) into your Excel table directly within your app without using flows

 

More details about SubmitForm function and Patch function, please check the following article:

SubmitForm function and Patch function in PowerApps

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Collect syntax

As far as the Collect function goes, I think the issue may be the double quotes. Instead of "Date", try Date (and so on for the other three items). 

 

With using Flow, I am afraid I can't speak too much to that; I am not too well versed in that area, unfortunately.

Super User
Super User

Re: Collect syntax

PowerApps can save to Excel directly. Why do you need Flow in the mix? What is your goal?

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Community Support Team
Community Support Team

Re: Collect syntax

Hi @Anonymous,

 

I think there is something wrong with the formula that you provided. Please take a try to modify your formula as below:

Collect(Info, 
{
Date:DatePicker1.SelectedDate,
Book:ComboBox3.SelectedItems, Sheet:Dropdown1.Selected,
Text:TextInput1.Text
}
)

 

For your second question, I agree with @Shanescows's thought almost. You could consider add your the Excel table of your Excel file as a data source within your app, then save your data (using SubmitForm function or Patch function) into your Excel table directly within your app without using flows

 

More details about SubmitForm function and Patch function, please check the following article:

SubmitForm function and Patch function in PowerApps

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Re: Collect syntax

@v-xida-msft This fixed it, thank you!

 

Your suggestion as to using submit form and patch functions looks really interesting, thanks (again!) Kris for your help. Unfortunately I don't think that will work since the data is to be saved into different sheets of different workbooks that aren't tables (and can't be) so flows may have to be the way to go... However as you've probably gathered i'm very new so your way may work.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (2,944)