cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dweaver450
Helper II
Helper II

ComboBox in Gallery copy selected itemto all rows

Hello,

 

I am having a difficult time copying the selected items from a ComboBox in a gallery to every row. What I need to do is if the checkbox value = true then copy the selected to every ComboBox in the gallery. I am setting the DefaultSelectedItems to

If PFCopyToAllCheckbox.value = true, XXXXX ------> I tried several different ways including Filter, Lookup, variable

but every time the checkbox is checked the Combobox selected values returns to blank and my variable, or collection is cleared. 

 

I am using a SQL view and everything works great if I don't try to copy the combobox.

Items

Items.jpg

 

 

 

My SQL View

'[dbo].[vSomaAssign]',
{
AssignmentDate
Terminal
DriverType
Driver
DriverID
LastName
Available
WorkingDrivers
WorkingDriversDelivery
AssignDateInt

}

The Gallery Items is set to

colPartialFarmRoutePUNumbered

gallery.jpg

 

 

The Combobox in the gallery

Items: Filter('[dbo].[v_SomaDriverAssign]', AssignDateInt = myPFDetailDateInt, StartsWith(DriverType, "Milk") Or DriverType = "Bulk Hauler II")
DisplayFields: ["WorkingDrivers","Terminal"]
DefaultSelectedItems: If(PFCopyToAllCheckbox.Value = true,-------> I have tried multiple things here inculding, filter, lookup, variables
IsSearchable: false,
SelectMultiple: false,
OnChange: Clear(colThisItem);ForAll(PFMilkHaulerComboBox.SelectedItems, Collect(colThisItem, {ID: CountRows(colThisItem)+1, Result:Last(FirstN(PFMilkHaulerComboBox.SelectedItems,CountRows(colThisItem)+1)).WorkingDrivers,MHID:DriverID}));

Collection

collection.jpg

 

When Copy to All Picks is checked, then the Milk Hauler selected should copy to all gallery rows.PowerApps Gallery.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @dweaver450 ,

 

You need to configure the UnCheck property of checkbox as follows to save the first combobox selected item to variable, and then assign the variable to DefaultSelectedItems property of combo box.

 

CheckBox.OnCheck: 

Set(varItem,First(GalleryName.AllItems).PFMilkHaulerComboBox.Selected)

PFMilkHaulerComboBox.DefaultSelectedItems :

varItem

GIF_92.gif

 

Hope this helps.

Sik 

View solution in original post

1 REPLY 1
v-siky-msft
Community Support
Community Support

Hi @dweaver450 ,

 

You need to configure the UnCheck property of checkbox as follows to save the first combobox selected item to variable, and then assign the variable to DefaultSelectedItems property of combo box.

 

CheckBox.OnCheck: 

Set(varItem,First(GalleryName.AllItems).PFMilkHaulerComboBox.Selected)

PFMilkHaulerComboBox.DefaultSelectedItems :

varItem

GIF_92.gif

 

Hope this helps.

Sik 

View solution in original post

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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

Top Solution Authors
Top Kudoed Authors
Users online (54,155)