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

Look up using 2 data sources

Hello,

 

My project is about Microsoft Dynamics sales quotes to be displayed on PowerApps.

I have a login page where the customer can login using his quote id.

-Lookup(Quotes, 'Quote ID'=quoteinput.text, Navigate(quotedetailscreen, none)

The quote detail screen shows the quote  details like quote id, name, created on etc.

eg: Lookup(Quote, 'Quote ID'=quoteinput.text, 'name')

 

I have imported another data source called "Notes" from Dynamics which contains the quote pdf which is generated in Dynamics. I was able to show it on screen.

-Lookup(Notes, 'Is Document'=true, 'File Name')

 

But when I input any quote ID in the login screen it displays the same pdf file name for all the IDs.

Should I use both quotes and notes as data sources in Lookup?

How to go about it?

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @praneethapradee ,

Is this error that you meant?

4141.PNG


Please put your mouse to see whether words like "delegation warning"  shows.

 If so, this is not error, this is a delegation warning.

That does not mean my formula is wrong, this is powerapps limit.

 

PowerApps could only deal with at least 2000 records in local. If your data source is larger than 2000 records, you need to use delegate data source and delegate functions to delegate data source to deal with data. Or else, your app may get wrong result.

If your data source is smaller than 2000 records, you just need to change delegation limit to 2000.

delegation.jpg

 If your data source is smaller than 2000 records, you need to modify your formula to only use delegate functions.

Since lookup field is not delegate in CDS, so I'm afraid you will always have delegation warning.

I suggest you save your data to collection firstly. Then use this collection as data source. In collection, there's no delegation limit.

Here's a doc about delegation:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

Here's a doc about delegate functions in CDS:
https://docs.microsoft.com/en-us/connectors/commondataservice/

 

 

Best regards,

 

 

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

View solution in original post

6 REPLIES 6
Carsten_Growth
Power Apps
Power Apps

As each Quote can have multiple Notes, Notes is a related entity. Therefore you would need to filter on all Notes related to Quote selected first. And then check if n Notes do have a file attachment you want to show

May I know the formula to get the PDF 'File Name' when user inputs 'Quote ID' in PowerApps?

 

Thank you.

Each note has a regarding attribute which is related to multiple entities. Also to Quote. So regarding attribute should equal selected quote ID in your case

Hi @praneethapradee ,

Do you want to get pdf names in Notes entity based on the 'Quote ID' in Quotes entity?

Could you tell me how do you save these pdf files to Notes entity? from  Quotes entity's attachments?

I assume that you save these pdf files from  Quotes entity's attachments.

If so, you need to not only filter Notes entity based on 'Is Document' field, but also need to filter based on 'Quote ID'.

Try this formula:

Filter(Notes, 'Is Document'=true,Regarding=Lookup(Quote,'Quote ID'=quoteinput.text)).'File Name'

//Regarding field is a lookup field in Notes entity which represents the record in related entity

If you want put these file name in a label, you need to use Concat function:

 

Concat(
Filter(Notes, 'Is Document'=true,Regarding=Lookup(Quote,'Quote ID'=quoteinput.text)),
'File Name'&",")

 

Best regards,

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

Hey,

 

Thank you for the reply.

 

Yes I want to get the PDF names based on 'Quote ID'

In Dynamics I have downloaded the pdf file and attached it to the timeline of the specific quote.

I have tried both your formulas but an error is popping up. (your solution.png)

I have linked some images of my screen below:

 

Screen 1: Login screen : Customer can enter the quote id (Data source :Quotes) 

Screen 2: Quote detail screen : Customer after logging in can see Quote details and the pdf attached(Data source : Notes where 'file name' is the name of the pdf and 'Is Document' = true to ensure the pdf is generated from dynamics and not created manually(false))

 

When the customer logs in with the quote id he should be able to view the quote details and the name of the pdf (File Name) attached to that respective quote only.

 

 

 

Hi @praneethapradee ,

Is this error that you meant?

4141.PNG


Please put your mouse to see whether words like "delegation warning"  shows.

 If so, this is not error, this is a delegation warning.

That does not mean my formula is wrong, this is powerapps limit.

 

PowerApps could only deal with at least 2000 records in local. If your data source is larger than 2000 records, you need to use delegate data source and delegate functions to delegate data source to deal with data. Or else, your app may get wrong result.

If your data source is smaller than 2000 records, you just need to change delegation limit to 2000.

delegation.jpg

 If your data source is smaller than 2000 records, you need to modify your formula to only use delegate functions.

Since lookup field is not delegate in CDS, so I'm afraid you will always have delegation warning.

I suggest you save your data to collection firstly. Then use this collection as data source. In collection, there's no delegation limit.

Here's a doc about delegation:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

Here's a doc about delegate functions in CDS:
https://docs.microsoft.com/en-us/connectors/commondataservice/

 

 

Best regards,

 

 

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

View solution in original post

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (21,359)