cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChenYung
Regular Visitor

Unable to get Custom field on User (CDS entity)

Hi there,
I am building Canvas app and have created a custom entity named 'Group policy' at User entity (CDS). 
A 'Request' entity has field Reviewer of Group Policy and I'd like to do Filter on the Gallery List of the Request.

Question 1:
I tried like below but failed because property options allowed for User() only got Email, Full Name, Image. User().'Group policy' will get error "Name isn't valid. This identifier isn't recognized".

 

 

Filter(varRequest, 'ReviewerGroup' = User().'Group policy')

 

Please advise.

Question 2:
How to filter 'Request' with group policy of login user if the Entities with relationship like below involved?
Example:
Entity "Request (Request Type)" has many-to-one to Entity "Request Type"
Entity "Request Type" has one-to-many to Entity "Workflow List (Request Type)"
Entity "Workflow List (Reviewer)" has many-to-one to Entity "Group Policy"
Entity "User (Group policy field as text)"
Any recommendation way to do this? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @ChenYung ,

 

For your first question, 'Group policy' column is in User entity, as you could find in this doc , User function will match the "Account" information that is displayed in the Power Apps players and studio. As the result, if you want to achieve your goal, you may leverage the formula below:

 

Filter(varRequest, 'ReviewerGroup' = LookUp(Users,'Primary Email'= User().Email).'Group policy')

 

You will need to add connection of entity Users first.

 

For the second question, could you please share more details about your scenario?

 

Let's clarify it step by step:

1. You could know current user in User entity through:

 

LookUp(Users,'Primary Email'= User().Email).'Group Policy'

 

2. You could retrieve workflow list with the previewer of current user:

Filter('Workflow List', Previewer = LookUp('Group Policy', 'Group Policy' = LookUp(Users,'Primary Email'= User().Email).'Group Policy')

 

3. Filter requests with the filtered request types:

 

Filter(Request,
      'Request Type' in 
             Filter('Workflow List',
                    Previewer = LookUp('Group Policy',
                                       'Group Policy' = 
                                       LookUp(Users,
                                             'Primary Email'= User().Email
                                       ).'Group Policy'
                                )
             ).'Request Type'
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @ChenYung ,

 

For your first question, 'Group policy' column is in User entity, as you could find in this doc , User function will match the "Account" information that is displayed in the Power Apps players and studio. As the result, if you want to achieve your goal, you may leverage the formula below:

 

Filter(varRequest, 'ReviewerGroup' = LookUp(Users,'Primary Email'= User().Email).'Group policy')

 

You will need to add connection of entity Users first.

 

For the second question, could you please share more details about your scenario?

 

Let's clarify it step by step:

1. You could know current user in User entity through:

 

LookUp(Users,'Primary Email'= User().Email).'Group Policy'

 

2. You could retrieve workflow list with the previewer of current user:

Filter('Workflow List', Previewer = LookUp('Group Policy', 'Group Policy' = LookUp(Users,'Primary Email'= User().Email).'Group Policy')

 

3. Filter requests with the filtered request types:

 

Filter(Request,
      'Request Type' in 
             Filter('Workflow List',
                    Previewer = LookUp('Group Policy',
                                       'Group Policy' = 
                                       LookUp(Users,
                                             'Primary Email'= User().Email
                                       ).'Group Policy'
                                )
             ).'Request Type'
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thanks a lot Jeffer. Will try on it.

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 (1,298)