cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted
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

 

Highlighted
Helper II
Helper II

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.

 

Highlighted
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

Highlighted
Helper II
Helper II

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.

Highlighted
Dual Super User III
Dual Super User III

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!
Highlighted
Helper II
Helper II

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,280)