cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VegetA3113
Frequent Visitor

ComboBox Default Not Updating

Hi all,

 

Please help if possible.

 

I have a ComboBox within a form that derived from a gallery selection.

The ComboBox shows the default name as entered and saved previously but does not allow me to submit the form again until I have manually selected the name again.

 

Detail below;

 

Items: Office365Users(SearchTerms:ComboBox1.Selected.DisplayName

 

DefaultDisplayItems:

ForAll(Collection1,{Value:ThisItem.Name1})

 

I may have made and error above as I'm going by memory but there are no errors anywhere in the coding.

 

I can see a few posts that relate to this issue but they didn't help me. One from back in 2019 stated that there is no fix at the time. Is there one now?

 

Any help would be appreciated.

8 REPLIES 8
classicman
Regular Visitor

The items property of your combobox should have a reference back to the source to maintain consistency.

 

Usually like Choices([@'yoursourcename'].personcolumnreference). Your DefaultSelectedItems would then remain as Parent.Default.

v-qiaqi-msft
Community Support
Community Support

Hi@VegetA3113,

Could you please share a bit more about the ComboBox:

  1. How you set the Items property of the Combo Box, you have provided a wrong formula?
  2. What is the collection1 in the ForAll() function?

I have a test on my side, please check as follows.

In my scenario, I have an SP list containing a Person column.

There is a Gallery where I can select a record and it navigates me to the form where I could update the record.

Combo Box Items:

 

Office365Users.SearchUser({searchTerm:DataCardValue4.SearchText})

 

Combo Box DefaultSelectedItems:

 

LookUp(TestPerson,ID=ThisItem.ID).People

 

The Data card corresponding to the Combo Box Update:

 

DataCardValue4.Selected

 

Note: 'TestPeople' is my SP list and the People is my Person column name, please replace it with yours.

DataCardValue4 represents the Combo Box.

If the above could not solve your problem, please provide more details.

Regards,

Qi

 

Hi,

 

I have tried but it does'nt work.

 

This is the defaultselected of the combobox;

ForAll(CDPStaff,{Value:ThisItem.Name1})

 

CDPStaff = SP List

Name1 = SP Column name

 

Cobobox Items = Office365Users.SearchUser({searchTerm:NameCard.SearchText})

 

The combo box is set to DIsplayName.

 

The Datacard Update = NameCard.Selected.DisplayName

 

Thus far the ForAll function is the only one i have tried that correctly displayed the default selection, though it doesn't maintain it once theform is reopened.

Hi@VegetA3113,

Could you please share the error message or more about the Name1 column?

I think you could try to set the ComboBox Items as below:

Choices(CDPStaff.Name1)

Regards,

Qi

 

Hi I have attached the picture

1.PNG

Hi@VegetA3113,

What I mean the error message is an error that will display when you hang over the red underline.

In addition, could you please tell me that if this Name1 is a Person column type?

Please do answer the above question.

Further, I think there is something misunderstanding between us. 

Do you want to duplicate an existing record or why you want to re-submit the form again?

Here is your scenario, you select a record in the Gallery and it navigates you to an edit form. Then you want to submit this existing record again. Is that right? I think the problem is that you want to submit the form in an edit mode which is forbidden in PowerApps.

Actually, I think the app in your scenario is generated based on your SP list directly. Therefore, when you select a record from the Gallery, it will navigate you to an edit form by default which means that you could only update the existing record rather than create a new record. 

If you really want to submit an duplicated record, here is an alternative solution you could check for reference.

Add a "save as new" Button in the form and set its Visible:

 

If(EditForm1.Mode=FormMode.Edit,true,false)

 

Set its OnSelect:

 

Patch(TestPerson,Defaults(TestPerson),{Title:DataCardValue3.Text,People:DataCardValue4.Selected})

 

 Note: Please replace the content in the {} with yours column names.

Hope it could help.

Regards,

Qi

So the error showing under 'Name1' LookUp(CDPStaff,ID=ThisItem.ID).Name1

"This formula uses scope, which is not presently supported for evaluation"

 

The Name1 table is a multi line text field in SP list and the ComboBox allows selection of Office365 user names and searched for "DisplayName".

 

On your point regarding not being able to submit an edit, this is not so as I can easily submit a change to a record's details. The issue here is the ComboBox and the fact that it does not retain its default selected display name unless the name is selected again manually. It then allows me to submit the form fine.

 

I do not wish to edit a record and save it again as a separate record, I simply want to ability to change the details if required. The form may not be fully completed the first time it is edited, the user may want to renter the record to add more details and at the moment they will have to make their combo box selected manually again for them to apply when in fact they should be set to default, they are showing as set to default but show the 'mandatory field error when submitted.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (64,345)