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

Dropdown menu is not patched in sp list

Hi, 

 

I have a repeating section where I have a dropdown and a multiselect dropdown. The values ​​are created in the collection but not sent to the Sharepoint list.

In the Building section is a form, each time information is entered within the repetitive section, it must be sent with the same name. If multiple rows are entered, all the rows entered must go with the same building name. The weird thing is that it doesn't allow me to add ".selected" to the other 2 dropdowns. Only Category works. 

 

Check BUTTOM repetitive section: 

 

Patch(ProjectCollection,

 ThisItem, {

ID: ID_value.Text,

Level: Level,

Category: Category_Value.selected,

Design: Design_Value

})

Collect(ProjectCollection,{

ID: "",

Level:

{

        Id: 0,

        Value:""

 },

Category:

{

        Id: 0,

        Value:""

 },

Design:

{

        Id: 0,

        Value:""

 },

 

ADD Buttom:

NewForm(FormProjectBuilding);

ClearCollect(ProjectCollection, {
Building:"",

Level:{
Id: 0,
Value:""
},

Category:{
Id: 0,
Value:""
},

Design:{
Id: 0,
Value:""
},

 

SAVE Buttom:

ForAll(ProjectCollection,If(!IsBlank(BidderSupplier),
Patch('BuildingList',Defaults('BuildingList'),{
'ID':ID,

'Level': Level, 

Category:Category,

Design: Design}))

 

 
 

 

10 REPLIES 10
BrianS
Super User
Super User

It could be an issue with the type of fields in your SP list. They will need to be the same as your Collection in order to receive the data - We can't tell that from what you sent.

SO24
Frequent Visitor

The field type is a choice. 

SO24_0-1606925544732.png

 

RandyHayes
Super User III
Super User III

@SO24 

What is the Items property of your Category_Value control?  It should be Choices(YourDataSource.Category).

If it is anything other than that, it will not have the required information to set a Choice column type.

 

My suggestions:

1) Your Button OnSelect action formula:

Patch(ProjectCollection,
    ThisItem, 
    {ID: ID_value.Text,
     Level: Level.Selected,
     Category: Category_Value.selected,
     Design: Design_Value
    }
)

2) Your Add OnSelect action formula:

 Well...I'm not really sure what you are doing in this one.  You are clearing your entire collection and then adding a row with no values?

3) Your Save Button OnSelect action formula:

ForAll(Filter(ProjectCollection, !IsBlank(BidderSupplier)),
    Patch('BuildingList',
        Defaults('BuildingList'),
        {
            Level: Level, 
            Category:Category,
            Design: Design
        }
    )
)

Don't try to set an ID when you create a record with Defaults...it will cause issues.

The above formula assumes your Level is a Choice column in SharePoint as well and that you have set the Items property of the Level control to Choices(yourList.Level)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
SO24
Frequent Visitor

Hi, Thanks for answering,

When I add the .selected inside the patch in each dropdown value, I get this error:

 

Invalid Argument Type. Expecting a Record value, but of a diferent schema. 

Missing column. Your Formula is missing a column 'ID', with a type of 'Number' 

The function patch has some invalid arguments. 

 

I think it is because in the collection maybe I am saving it as type number. The strange thing is that the Category values ​​are saved in the collection but not shown in the list.

 

In Items value: Choices('BuildingList'.'Level'), And so, I get the values ​​of the choice.

RandyHayes
Super User III
Super User III

@SO24 

This is why my very first statement:

What is the Items property of your Category_Value control?  It should be Choices(YourDataSource.Category).

If it is anything other than that, it will not have the required information to set a Choice column type.

 

Please look at your Items property.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
SO24
Frequent Visitor

Yes, so it is. The weird thing is that in the patch I get that error when I want to put:

Level.selected 😞 😕

SO24
Frequent Visitor

Category and Level has the same code. 

The difference is that Category is a Lookup and works but Level is only a choice of this List. 

In the collection, Level is blank BUT Categories has information and the data is sent to the list.

SO24_0-1607010381142.png

 

RandyHayes
Super User III
Super User III

@SO24 

Which Patch statement is giving you the error?  The one where you patch it to a collection or the one where you patch to the datasource?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
SO24
Frequent Visitor

In the collection patch, here:

Patch(ProjectCollection,

 ThisItem, {

ID: ID_value.Text,

Level: Level,     (The .Selected should go here but it won't let me because it gives me that error)

Category: Category_Value.selected,

Design: Design_Value

})

Collect(ProjectCollection,{

ID: "",

Level:

{

        Id: 0,

        Value:""

 },

Category:

{

        Id: 0,

        Value:""

 },

Design:

{

        Id: 0,

        Value:""

 },

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (985)