cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
notj
Post Prodigy
Post Prodigy

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

PavanKumar
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
PavanKumar
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

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

 

PavanKumar
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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,049)