cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iruser2
Level: Power Up

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
Level 10

Re: using / linking two tables in a power app

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.

Community Support Team
Community Support Team

Re: using / linking two tables in a power app

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.
iruser2
Level: Power Up

Re: using / linking two tables in a power app

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

iruser2
Level: Power Up

Re: using / linking two tables in a power app

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?

 

 

 

 

 

 

 

Community Support Team
Community Support Team

Re: using / linking two tables in a power app

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.
ajyendra24
Level: Powered On

Re: using / linking two tables in a power app

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,261)