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

User LookUp no longer works?

I am patching a record in common data service and have a custom field called "Completed By" which is a LookUp to the Users field. This is the line in the patch with a problem:

 

'Completed By': First(Filter(Users, 'Primary Email'=ssplc_completedby))

 

This has previous worked, but now throws an error: "The 'Access Mode' column in the data source you're updating expects an 'OptionSetValue' type and you're using 'OptionSetValue' type."

 

This doesn't make sense as it's clearly not an option set.

6 REPLIES 6
Dual Super User
Dual Super User

Re: User LookUp no longer works?

Hi @chris61 

 

Issue probably is in the ohter columns you are patching, can you share the whole patch command

 

also, 

'Completed By': First(Filter(Users, 'Primary Email'=ssplc_completedby))

use

'Completed By': Lookup(Users, 'Primary Email'=ssplc_completedby)

 

Lookup is a more efficient way of doing First(Filter

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

chris61
Level: Powered On

Re: User LookUp no longer works?

Thank you for your reply.

 

I know that it is this line for sure because when I comment it out the rest of the Patch works.

 

'Completed By': LookUp([@Users], 'Primary Email'=ssplc_completedby) - this produces the same error.

 

Dual Super User
Dual Super User

Re: User LookUp no longer works?

Hi @chris61 

 

Just add a temp label for testing prupose and see if

 

LookUp([@Users], 'Primary Email'=ssplc_completedby).'Primary Email' returns a value

If yes, then must be some bug in the patch

chris61
Level: Powered On

Re: User LookUp no longer works?

The label returns a value. I've taken a screenshot of the patch. Everything is taken out except for the LookUp and still getting the error.

Dual Super User
Dual Super User

Re: User LookUp no longer works?

Hey @chris61 

 

Can you try to update your expression as:
 
'Completed By': LookUp(
                Choices(EntityName.ColumnName),
                'Primary Email'=ssplc_completedby
            )
 
Here, you need to update the EntityName with the name of Parent Entity and ColumnName with the name of column used to create lookup for Users entity.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
chris61
Level: Powered On

Re: User LookUp no longer works?

I'm getting inconsistent performance with this still despite the great responses I've received.

 

This is an example of a formula being used:

 

If(
CountRows(colTechsToBeUploaded) > 0,
UpdateContext({locUploadStatus: "Syncing Techs to Activities"});
ForAll(colTechsToBeUploaded,
Patch('Shift Activity Assistants',
Defaults('Shift Activity Assistants'),
{
'Shift Activity': LookUp('Shift Activities', 'Activity UID'=LinkedActivity),
Assistant: LookUp(Users, User=UserID),
Name: Name
}
));

 

I still get the original error message upon loading the app. The line with the issue is:

 

Assistant: LookUp(Users, User=UserID),

 

Now I went to add an Email field and try looking up on that instead of the GUID. I added it in, had to restart my app a few times but then the above line started working and giving no errors!

 

Very perplexed, is this a bug?

 

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,137)