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.

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.

View solution in original post

Thanks a lot Jeffer. Will try on it.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,687)