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)

---------------------------------------------------------------------------------------------------------------------------


Was I helpful? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. It will help other users to find it faster.

follow me on Twitter @zmansuri123,
connect with me on LinkedIn from Here

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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