cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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.

Frequent Visitor

The field type is a choice. 

SO24_0-1606925544732.png

 

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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.

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

Level.selected 😞 😕

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

 

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (32,676)