cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Continued Contributor
Continued Contributor

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
Responsive Resident
Responsive Resident

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

Responsive Resident
Responsive Resident

@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
Responsive Resident
Responsive Resident

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

Continued Contributor
Continued Contributor

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

 

Responsive Resident
Responsive Resident

@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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,075)