cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kiendao911990
Frequent Visitor

Need help on getting Account Name of an account from an Opportunity in Canvas app

Hi Power Apps Community,

 

My issue is that I could not get the value of Account Name field of Account entity in my canvas app.

 

As I know that Power Apps does not allow to get value of a field from an related entity.

 

So I tried the following ways to get Account name from an opportunity (ModelDrivenFormIntegration refers to Opportunity entity)

1. LookUp(Accounts, accountid = [@ModelDrivenFormIntegration].Item.Account, 'Account Name')

2. LookUp(Accounts, Account = [@ModelDrivenFormIntegration].Item.Account, 'Account Name')

3. First(Filter(Accounts, accountid = [@ModelDrivenFormIntegration].Item.Account)).'Account Name'

4. First(Filter(Accounts, Account = [@ModelDrivenFormIntegration].Item.Account)).'Account Name'

 

The result is always empty

Screen Shot 2020-04-25 at 3.21.30 PM.png

All Opportunities in Sales application have an related account

Screen Shot 2020-04-25 at 3.37.08 PM.png

 

I was also wondering if LookUp function works properly, so i made a following small test, and Account Name shown up.

Screen Shot 2020-04-25 at 3.21.49 PM.png

 

So I guess the root cause lied in the condition of LookUp or Filter function but I don't know how to fix it.

 

Look forward to your solution / advice.

 

Many thanks,

Nhan

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @kiendao911990 :

Could you tell me what the relationship is between opportunity and Account? N:1? Or 1:N ? Or N;N?

Firstly, let me explain why the result is always empty.

The point is the ModelDrivenFormIntegration control does not provide a value for fields of a related entity.

So the result of  [@ModelDrivenFormIntegration].Item.Account is an empty table.

Finally, Ive made some test for your reference:

I assume the relationship between opportunity and Account is N;1.

 

LookUp(Opportunities,Opportunity=[@ModelDrivenFormIntegration].Item.Opportunity).Account.'Account Name'

 

 

The point is going back to your data source(Opportunity) to find the specified record to refer to the value of the relevant entity.

I think this link will help you a lot:

Known issues and limitations with embedded canvas apps

Best Regards,

Bof

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @kiendao911990 :

Could you tell me what the relationship is between opportunity and Account? N:1? Or 1:N ? Or N;N?

Firstly, let me explain why the result is always empty.

The point is the ModelDrivenFormIntegration control does not provide a value for fields of a related entity.

So the result of  [@ModelDrivenFormIntegration].Item.Account is an empty table.

Finally, Ive made some test for your reference:

I assume the relationship between opportunity and Account is N;1.

 

LookUp(Opportunities,Opportunity=[@ModelDrivenFormIntegration].Item.Opportunity).Account.'Account Name'

 

 

The point is going back to your data source(Opportunity) to find the specified record to refer to the value of the relevant entity.

I think this link will help you a lot:

Known issues and limitations with embedded canvas apps

Best Regards,

Bof

View solution in original post

aoqunbrush
New Member

Guangzhou Aoqun Brush Industry Technology Co., Ltd. is a large brush manufacturing enterprise combining design, development, production, sales and service.

Brush, Strip Brush, Cleaning Brush, Roller Brush and different other products with "Aoqun" brand sell well in more than 50 countries around the world, professional in over 30 industries, also cooperating with the world-famous enterprises, like CRRC Group, Schinder, Hitachi, Kone and Combi etc.

Adhering to the tenet that "Integrity shapes our futures'', with the oringinal spirit of "Profession, Concentration and Focus", persisting in scientific management, pursuing superior quality, Aoqun Company always produces every piece of satisfying brush with heart. We are committed to build an excellent brand of our nation, and make more contribution to "Made with Wisdom in China".

https://www.aoqunbrush.com/

Hi Bof,

 

The relationship is N:1.

Thank you very much for your help.

I can get the value of Account Name field now.

 

Cheers,

Nhan

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (55,489)