cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
david_castillo Helper III
Helper III

PowerApps to SP Combo Box Patches the Same Value

Hello!

 

I have the following data for my Patch function to SharePoint:

 

Patch('SP-CM-Test',Defaults('SP-CM-Test'),{
    Title:CardNo.Text,
    MIN:MIN.Text,
    BusinessName:BizName.Text,
    AuthorizedRep:CO.Text,
    BusinessAddress:BizAdd.Text,
    Attendee:AttendeeName.Text,
    Position:Position.Text,
    FBUserName:FBUsername.Text,
    DateAttended:DateAttended.SelectedDate,
    Merch: ForAll(
                               Merch.SelectedItems,
                               {
                                 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                                  Value: Merch.Selected.Value
                               }
                          ),
    TopicsTrained:{
                                 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                                  Value: TopicsTrained.Selected.Value
                               }

});

Here are the fields:

 

Page 1:

page1sample.png

 

Page 2:

page2sample.png

Merchandise Combobox values currently are:

Merch 1

Merch 2

Merch 3

 

For some reason, when I patch the Merchandise combo box and pick more than one choice (for example, I picked Merch 1, Merch 2), it seems to only get the value of Merch 3, even though I selected two items. Please note that I used ForAll when patching.

 

Here is the screenshot in SharePoint:

 

merchsample.png

 

It acknowledges the number of choices I picked, but always defaults to the highest (?) choice tier.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: PowerApps to SP Combo Box Patches the Same Value

Hi @david_castillo ,

 

Is the Merch column a Choice type column (which enables multiple options) within your SP list? Please try below formula:

ClearCollect(
    ChoiceCollection,
    ForAll(Merch.SelectedItems,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:Value})
);
Patch(
        'SP-CM-Test',
        Defaults('SP-CM-Test'),
        {
          Title:CardNo.Text,
MIN:MIN.Text,
BusinessName:BizName.Text,
AuthorizedRep:CO.Text,
BusinessAddress:BizAdd.Text,
... Products_x0020_2: ChoiceCollection }
)  

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: PowerApps to SP Combo Box Patches the Same Value

Hi @david_castillo ,

 

Is the Merch column a Choice type column (which enables multiple options) within your SP list? Please try below formula:

ClearCollect(
    ChoiceCollection,
    ForAll(Merch.SelectedItems,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:Value})
);
Patch(
        'SP-CM-Test',
        Defaults('SP-CM-Test'),
        {
          Title:CardNo.Text,
MIN:MIN.Text,
BusinessName:BizName.Text,
AuthorizedRep:CO.Text,
BusinessAddress:BizAdd.Text,
... Products_x0020_2: ChoiceCollection }
)  

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

david_castillo Helper III
Helper III

Re: PowerApps to SP Combo Box Patches the Same Value

It worked! Thanks a lot, Mona!

 

For the other people to see, I retained my code but changed the Value: Merch.Selected.Value to Value:Value. It seems I misunderstood how the Value works - instead of calling the actual value, I'm calling the dropdown only.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,837)