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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (26,240)