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

Patching User Lookup on CDM

I have an custom entity with a field that lookups to systemuser called Reviewer. I am able to patch other lookup fields on that entity but for some reason I receive an error when I add to update the lookup field to systemuser. See below:

 

Annotation 2019-09-20 091612.png

 

It seems like it wants to update the user record and is throwing an error because I am not including the required field('Access Mode'), but I do not want to update the user record just the lookup value. I find it strange that it works for the other lookups in this same command but get an error on this one.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Patching User Lookup on CDM

Hi @JohnBrown ,

Could you please share a bit more about the Reviewer column? Is it a LookUp column which references values from the Users Entity?

Could you please share a bit more about the ComboBox_Reviewer? Which formula do you put within the Items property of the ComboBox_Reviewer?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:3.JPG

Set the Items property of the ExternalUser ComboBox to following:

Choices([@TaskLists].ExternalUser)

Set the OnSelect property of the "Submit" button to following:

Patch(
TaskLists,
Defaults(TaskLists),
{
'Primary Name': "PowerApps & Python",
ExternalUser: DataCardValue7.Selected
}
)

On your side, please make sure the Items property of the ComboBox_Reviewer to following:

Choices([@YourEntity].ReviewerColumn)          /* <-- ReviewerColumn represents the LookUp column in your Entity */

Then modify your Patch formula as below:

Patch(
YourEntity,
Defaults(YourEntity),
{
...,
ReviewerColumn: ComboBox_Reviewer.Selected,
...
}
)

According to the error message that you mentioned, it seems to tell that there is something wrong with the value you provided for the "Access Mode" column (Option Set type column). Please check if you have provided a proper Option Set value for the "Access Mode" in your Patch formula.

More details about setting a value for a Option Set column, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/option-sets-and-many-to-many-relationships-for-canvas-app...

 

Please also check and see if the response within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-and-Load-a-user-record-from-CDS-into-p...

 

Best regards,

Community Support Team _ Kris Dai
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: Patching User Lookup on CDM

Hi @JohnBrown ,

Could you please share a bit more about the Reviewer column? Is it a LookUp column which references values from the Users Entity?

Could you please share a bit more about the ComboBox_Reviewer? Which formula do you put within the Items property of the ComboBox_Reviewer?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:3.JPG

Set the Items property of the ExternalUser ComboBox to following:

Choices([@TaskLists].ExternalUser)

Set the OnSelect property of the "Submit" button to following:

Patch(
TaskLists,
Defaults(TaskLists),
{
'Primary Name': "PowerApps & Python",
ExternalUser: DataCardValue7.Selected
}
)

On your side, please make sure the Items property of the ComboBox_Reviewer to following:

Choices([@YourEntity].ReviewerColumn)          /* <-- ReviewerColumn represents the LookUp column in your Entity */

Then modify your Patch formula as below:

Patch(
YourEntity,
Defaults(YourEntity),
{
...,
ReviewerColumn: ComboBox_Reviewer.Selected,
...
}
)

According to the error message that you mentioned, it seems to tell that there is something wrong with the value you provided for the "Access Mode" column (Option Set type column). Please check if you have provided a proper Option Set value for the "Access Mode" in your Patch formula.

More details about setting a value for a Option Set column, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/option-sets-and-many-to-many-relationships-for-canvas-app...

 

Please also check and see if the response within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-and-Load-a-user-record-from-CDS-into-p...

 

Best regards,

Community Support Team _ Kris Dai
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

JohnBrown
Level: Powered On

Re: Patching User Lookup on CDM

@v-xida-msft

This is in a canvas app and the Reviewer column is a lookup to the users entity. The combobox had
Items: [@Users]
I am not sure why it did not work but when I changed it to be Choices([@Custom_Entity].Reviewer) it resolved the error. Thank you!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Users Online
Currently online: 292 members 4,463 guests
Please welcome our newest community members: