cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris61
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
RezaDorrani
Dual Super User II
Dual Super User II

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

 

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.

 

RezaDorrani
Dual Super User II
Dual Super User II

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

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.

yashag2255
Dual Super User II
Dual Super User II

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!

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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