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

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
v-monli-msft
Community Support
Community Support

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
v-monli-msft
Community Support
Community Support

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,646)