web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How can I query for we...
Power Apps
Unanswered

How can I query for web roles?

(0) ShareShare
ReportReport
Posted on by 24

Hey all, been trying to figure this out for a little bit. I am trying to figure out how can I query for web roles related to current users in the contact table. I have a portal which is not an enhanced data model, and I have 18 or so contacts which a different range of web roles. I have a modal that pops us and allows a user select another user and they can perform an action on behalf of the user they selected. In my modal I want the web roles to appear in a column next to the users so the users can be searched by the web roles if needed. Issue is I dont see a web role table for the non enchanced data model. I do know that there is a relationship between the contact table and web role table which is 

 
adx_webrole_contact
 
Currently my fetch looks like 
 
fetch('/_api/contacts/?$select=firstname,lastname,emailaddress1,_owningbusinessunit_value )
.then(response => {
 
if (!response.ok) {
throw new Error('Network response was not ok: ' + response.statusText);
}
return response.json();
})
.then(data => {
console.log("CONTACT DATA IS", data )
this.users = data.value.map(user => ({
firstName: user.firstname,
lastName: user.lastname,
email: user.emailaddress1,
organization: user["_owningbusinessunit_value@OData.Community.Display.V1.FormattedValue"] || "No Organization",
contactid: user.contactid

}));
this.filteredUsers = this.users;
})
.catch(error => {
console.error('Failed to fetch users:', error);
});

any help is appreciated
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard