cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iruser2
New Member

using / linking two tables in a power app

Hi folks

 

I've read a few posts on how to link two tables to use within a powerapp but am not able to follow the directions properly.

 

I am linking to Dynamics 365

 

I want to look at opportunities, where the owner_id_value is stored, but the guid number is useless so i need to link in the users table to look up the guid number and get the fullname field.

 

Opportunities = table .ownerid_value = field

should match to

Users = table user = field

 

So i cannot use the lookup function as the field names are not the same. (i dont quite follow the syntax of that function either however).

 

Can someone assist with the applicable formula please.

 

thanks!

 

6 REPLIES 6
Meneghino
Community Champion
Community Champion

Hi @iruser2

Happy to assist but from your question I am not sure of the column names/types and relations you are using.

I think what you need are a lookup and a filter, something like this:

 

Filter(Opportunities, owner_id_value = LookUp(Users, full_name = MyFullName, ID))

Where the LookUp get the ID of the user where the full_name is equal to MyFullName (a variable)

Then the filter will return all opportunities where owner_id_value equals the ID returned from the LookUp.

 

Please let me know if this works, otherwise please clarify the table structure and how to define the user needed.

v-micsh-msft
Community Support
Community Support

Hi @iruser2,

 

So here you would like to display the owner_id_value field with the User FullName stored in the Users entity, right?

If opportunities is configured within a Gallery, and the Full Name is expected to show in a Label control, then the formula for the full name should be as below:

LookUp(Users,systemuserid=ThisItem._ownerid_value, fullname)

Before using the formula above, the users Entity need to be loaded in PowerApps, follow View or change a Data Source in the article here to add it into PowerApps.

 

Besides, we could add a OwnerFullName field with the Opportunities with the AddColumns function, for example, the following code:

AddColumns(
          Opportunities,            
         "OwnerFullName",
         LookUp(Users,systemuserid=_ownerid_value, fullname)
)

Would add a temporary "OwnerFullName" field in the internal table in PowerApps, which should be able to show the OwnerName based on the OwnerID value.

AddColumns function in PowerApps

Lookup function in PowerApps

Image reference:

42.PNG43.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi - thanks for the reply.I dont think the look up works as the field names on the two tables do not match.

Hi Michael

 

Thanks for the suggestions. 

 

I'm not sure i understand how to add in another entity.  When i do that dont i lose all the connections to the opportunities table?

 

I see that you have screen shots that show your formula's working.  I dont know enough power apps to follow the link you sent about adding the column.  The link you sent talked about adding a button.  Your screen shots dont have a button.

 

Are your screenshots getting the user name from the user table in CRM?

 

 

 

 

 

 

 

Hi @iruser2,

 

You will not lose the connections.

 

I didn't mention any button control, I mean Label control.

And yes, the user entity is from Dynamics 365.

 

Regards,

Michael

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-micsh-msft  ,

 

Is it work for DataTable in PowerApps? As I saw You are using Gallery instead of that if I am using DataTable The Lookup is not working as per your mentioned formula.

 

Thanks 

Ajyendra

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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