cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dineke
New Member

Patch-function: record is only updated when dropdown is changed

Hi all,

 

I am new to Powerapps en trying to build a few apps.

In one of my apps  there is a BrowseGallery.

When I select an item in the gallery, I have the opportunity to change te record.

When I do this, my changes are only stored when I change one of the dropdowns (this dropdown contains the members of the Sharepoint-group). How can I solve this?

 

See below the code that is attached to the IconAccept1.Onselect event:

 

If(EditForm1.Mode=FormMode.New;
Patch(BronLeveranciersbeoordeling;
Defaults(BronLeveranciersbeoordeling);
{Title: DataCardValue5.Text;
Rating:Value(DataCardValue6.Text);
Medewerker: {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
Claims:"i:0#.f|membership|" & Lower(LookUp(SharePointGroupMembers;displayName=ComboBox1.Selected.displayName).mail);
Department:"";
DisplayName: ComboBox1.Selected.displayName;
Email: "";
JobTitle: "";
Picture:"."}});
Patch(BronLeveranciersbeoordeling;
BrowseGallery1.Selected;
{Title: DataCardValue5.Text;
Rating:Value(DataCardValue6.Text);
Datum: DataCardValue7.SelectedDate;
Medewerker: {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
Claims:"i:0#.f|membership|" & Lower(LookUp(SharePointGroupMembers;displayName=ComboBox1.Selected.displayName).mail);
Department:"";
DisplayName: ComboBox1.Selected.displayName;
Email: "";
JobTitle: "";
Picture:"."}}))
;;
Navigate(BrowseScreen1;ScreenTransition.None)

5 REPLIES 5
zmansuri
Super User
Super User

before this code try 

Reset(ComboBox1)

Dineke
New Member

-

Thank you for your reply.

Unfortunately, this doesn't make a difference...

Hi @Dineke,

Have your solved your problem?

Do you want to save the form changes when gallery selected a special record in the edit mode?

Could you please tell me that how you set the Items and DefaultSelectedItems property of the ComboBox1?

I think the key to this issue is how you configure the ComboBox1.

From your description, I think the ComboBox1 could not reflect the corresponding value when you select a record from the Gallery, so you should set the DefaultSelectedItems to populate the ComboBox1 based on the Gallery.Selected.

Generally, if you set the ComboBox1 Items property as below Choices() formula, you should set the DefaultSelectedItems as the second ThisItem() formula

Choices(BronLeveranciersbeoordeling.Medewerker)
ThisItem.Medewerker

Go and check if this could help you.

Best Regards,
Qi

Hi @v-qiaqi-msft ,

 

Thank you for your reply.

The problem is not solved yet.

 

This is how the properties were set:

Items: 

SharePointGroupMembers.displayName

SharePointGroupMembers is a collection.

 

DefaultSelectedItem:

{Value:BrowseGallery1.Selected.Medewerker.DisplayName}

 

I changed it to what you suggested, but now Combobox1 doesn't contain any names.

 

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (991)