cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
notj
Level: Powered On

ClearCollect a choice field?

I was following along with @Shanescows videos on making Repeating Tables in PowerApps and I've kinda stumped myself. Here's the video: https://www.youtube.com/watch?v=xgznk4XlPCo

 

My problem is I deviated from the example provided and I'm not positive how to do so correctly. One of the fields is a drop down. On my button I have the following: 

NewForm(Form3);ClearCollect(SiteVisitCollection, {StateCMSSurveyDate: "", SurveyOutcome: "", SiteVisitandType: ""}); Navigate(Screen1, ScreenTransition.Cover)

SurveyOutcome is the drop down used on Screen1. 

 

The OnSelect of my save button is giving me an error and I don't think it likes how I have SurveyOutcome listed.

 

Here's my save button "OneSelect":

Patch(SiteVisitCollection, ThisItem, {Title:"Title", StateCMSSurveyDate: Value(SurveyDatePicker.SelectedDate), SurveyOutcome: SurveyOutcomeDropdown.Selected}); Collect(SiteVisitCollection, {StateCMSSurveyDate: "", SurveyOutcome: ""})

The error I get when hovering over it is 

The type of this argument "SurveyOutcome" does not match the expected type "text". Found type"Record".
2 ACCEPTED SOLUTIONS

Accepted Solutions
PavanKumar
Level 8

Re: ClearCollect a choice field?

Hi @notj ,

 

I hope you have bound SiteVisitCollection to your dropdown.

 

In the patch formulae change it to below

 

Patch(SiteVisitCollection, ThisItem, {Title:"Title", StateCMSSurveyDate: Value(SurveyDatePicker.SelectedDate), SurveyOutcome: SurveyOutcomeDropdown.Selected.SurveyOutcome});

If you just mention SurveyOutcomeDropdown.selected then you are trying to bind a selected record to field SurveyOutcome (which is wrong). You should give the surveyoutcome value to the corresponding field. You can get the particular field value from SurveyOutcomeDropdown.Selected.SurveyOutcome

 

 

if this answers your question mark it as verified and give thumbsup

Regards,

Pavan Kumar Garlapati

 

View solution in original post

PavanKumar
Level 8

Re: ClearCollect a choice field?

@notj ,

 

That's right. If you bind collection with multiple columns to the dropdown then you need to select the partcular column value of the selected record. i.e. dropdown.selected.selectedcolumn.

 

if you bind only one column collection to the dropdown then you can directly use dropdown.selected.value.

 

if this answers your question mark it as verified and give thumbsup

Regards,

Pavan Kumar Garlapati

View solution in original post

3 REPLIES 3
PavanKumar
Level 8

Re: ClearCollect a choice field?

Hi @notj ,

 

I hope you have bound SiteVisitCollection to your dropdown.

 

In the patch formulae change it to below

 

Patch(SiteVisitCollection, ThisItem, {Title:"Title", StateCMSSurveyDate: Value(SurveyDatePicker.SelectedDate), SurveyOutcome: SurveyOutcomeDropdown.Selected.SurveyOutcome});

If you just mention SurveyOutcomeDropdown.selected then you are trying to bind a selected record to field SurveyOutcome (which is wrong). You should give the surveyoutcome value to the corresponding field. You can get the particular field value from SurveyOutcomeDropdown.Selected.SurveyOutcome

 

 

if this answers your question mark it as verified and give thumbsup

Regards,

Pavan Kumar Garlapati

 

View solution in original post

notj
Level: Powered On

Re: ClearCollect a choice field?

So I did SurveyOutcomeDropdown.Selected.Value and it seems to be working so far. Is that the same as doing SurveyOutcomeDropdown.Selected.SurveyOutcome?

 

PavanKumar
Level 8

Re: ClearCollect a choice field?

@notj ,

 

That's right. If you bind collection with multiple columns to the dropdown then you need to select the partcular column value of the selected record. i.e. dropdown.selected.selectedcolumn.

 

if you bind only one column collection to the dropdown then you can directly use dropdown.selected.value.

 

if this answers your question mark it as verified and give thumbsup

Regards,

Pavan Kumar Garlapati

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 410 members 2,843 guests
Please welcome our newest community members: