cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PedroPereira
Level: Powered On

Patch a new row with a Dropdown value to Sharepoint source

Hello,

 

I am trying to create a new row in my sharepoing list. This is reagarding the users management accessments.

 

The list have two fields the name (of the users) and choice with different access types (admin/viewer,...). The name is a input text and the choice is a dropdown. I am trying to add a new row but I am strugling with it.

 

I suspect the problem is based on the way I am showing my dropdown values. The item of the AccessDropdown is equal to: 

Distinct(Sort(UserAccessManagement,AccessType.Value),AccessType.Value)

The sharepoing list is the UserAccessManagement and the Access Type is the multiple tipoligies (admin/viewer...). I have given this instrunction to the dropdown to shown only one option of which access type (if there were two adminds on my sharepoing it would be displayed "Admin").

 

Because of this funciton I have to use 

AccessDropdown.Selected.Result

 instead of 

AccessDropdown.Selected.Value

 

However when I try to patch the new value to the Sharepoing list I have a problem regarding its structure. Error "The type of argument "AccessType" does not match  the expected type "Record". The function used was: 

Patch(UserAccessManagement, Defaults(UserAccessManagement),{Title: GiveAccessToUser.Text, AccessType: AccessDropdown.Selected.Value})

 

I also tried by this way without success: 

Patch(UserAccessManagement, Defaults(UserAccessManagement),{Title: GiveAccessToUser.Text, 
        AccessType:
        {
       '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
        Id:1,
        Value:"Admin"
        }
 })

 

Do you have any ideas? What I am doind wrong?

 

Thanks in advance.

Pedro Pereira

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Patch a new row with a Dropdown value to Sharepoint source

Hi @PedroPereira ,

 

May I know why you want to use a customized dropdown control? Since you said that AccessType is a choice column, then you could set the options from the SharePoint list side. Just give the options of what you need "admin/viewer,..." without duplicated values. Then in PowerApps Edit Form, this choice column would automantically display as a Dropdown control with the options you give in SharePoint. 

 

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 Team
Community Support Team

Re: Patch a new row with a Dropdown value to Sharepoint source

Hi @PedroPereira ,

 

May I know why you want to use a customized dropdown control? Since you said that AccessType is a choice column, then you could set the options from the SharePoint list side. Just give the options of what you need "admin/viewer,..." without duplicated values. Then in PowerApps Edit Form, this choice column would automantically display as a Dropdown control with the options you give in SharePoint. 

 

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

PedroPereira
Level: Powered On

Re: Patch a new row with a Dropdown value to Sharepoint source

Hello,

 

What a waste of time I have done... And the solution was as basic as you have said. Thank you for your help 🙂 

 

Regards,

Pedro Pereira

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,783)