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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Entity Notes no longer...
Power Apps
Answered

Entity Notes no longer returning records in canvas app

(0) ShareShare
ReportReport
Posted on by 382

Hi All,

I have a canvas app that takes an image and stores it as a Notes attachment on a CDS entity. It's been working great for a while, but recently the Notes data source in the app stopped returning records for a given entity.

To be clear, the attachment is still created and I can see it in a model-driven app I just can't seem to retrieve entity notes in the canvas app using this syntax: "FooEntity.Notes". I get no records returned.  Tried to drop the data source and re-add and no luck.

Anyone aware of changes that have affected this feature or seeing anything similar?

Thanks!

Categories:
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @Helpful 

     

    Could you share more details about how did you call the related Notes entity?

    I have made a test on my side, but don't have any issue, the Note entity can be called perfectly.

    FooEntity has 1:N relationship to Notes entity, If you want to call the related Notes, the syntax should be:

     

    First(FooEntity).Notes

     

    Then it will return all Notes records related to the first record of FooEntity.

    Could you delete the FooEntity and Notes connection and re-add it, and try my formula to check if the issue still exists.

    Snipaste_2020-02-03_16-41-13.png

    If it still doesn't work, please share more information and screenshots.

    Sik

  • Helpful Profile Picture
    382 on at

    Hey @v-siky-msft,

    In my case, Foo is an Expense so see below...

    I have two screens:  a gallery and then a detail screen.  The Notes are referenced on each.

    On the gallery screen, the syntax is:  ThisItem.Notes.  When the user selects an item, it sets a variable and navigates to the detail screen.

    On the detail screen the syntax is:  SelectedExpense.Notes

    Additional details:

    • This syntax worked a couple of weeks ago without issue - not sure of exact date when misbehavior started.
    • I have dropped/re-added both Expenses and Notes data sources - no change.
    • When I evaluate the syntax in the formula bar it identifies Notes as "Data type: Table", but finds no rows.
    • I can still add a note to an Expense successfully using syntax:  Relate(SelectedExpense.Notes, Patch(Notes, Default(Notes), {fields}));
    • I have tried to toggle various combinations of app settings with no luck.

    When I create a test like yours, I can create two screens:  a gallery of Expenses and a gallery of Notes.

    On the Notes gallery, I set Items = ExpenseList.Selected.Notes and it fetches them properly, however, if I select that syntax in the formula bar it reports "We didn't find any data".  If I add a new screen in my existing app and use the same syntax it fetches records to populate the list.

    UPDATE

    I have found that it does not like looking at Notes inside a context.  For example, on my gallery of Expenses this no longer works for each item:  LookUp(ThisItem.Notes, "mobile_receipt" in 'File Name').'Mime Type', however, CountRows(ThisItem.Notes) returns the correct value.

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @Helpful 

     

    Please modify the variable definition as below

    Set(SelectedExpense, ThisItem)

    Set the Detail Screen syntax:

    SelectedExpense.Notes

    Then it will work.

    Sik

     

  • Helpful Profile Picture
    382 on at

    Thanks for taking a look, @v-siky-msft.

    Here's a screenshot of the Expense gallery item image loading formula:

    ExpenseGalleryItem.png

    When the user selects an Expense, the OnSelect is:

     

    Set(SelectedExpense, ThisItem); 
    Navigate(ExpenseEntry, ScreenTransition.UnCover)

     

    Then in the ExpenseEntry OnVisible:

     

    If(!IsBlank(SelectedExpense), 
     UpdateContext({MobileReceiptNote: LookUp(SelectedExpense.Notes, "mobile_receipt" in 'File Name')})
    );

     

    and finally the Image control has an Image property set to:

     

    If(!IsBlank(MobileReceiptNote),
    
     Switch(MobileReceiptNote.'Mime Type',
     "image/png", Concatenate("data:image/png;base64,", MobileReceiptNote.Document),
     "image/jpeg", Concatenate("data:image/jpeg;base64,", MobileReceiptNote.Document),
     "image/jpg", Concatenate("data:image/jpg;base64,", MobileReceiptNote.Document),
     SampleImage
     )
    ,
     First(CameraImage).Photo
    )

     

    When the user takes a photo and saves it the filename always includes "mobile_receipt".  This approach has been solid for quite a while.  I hope you can identify the issue!  I suspect it's with the LookUp.

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @Helpful 

    In my test, I find "!IsBlank(LookUp(ThisItem.Notes,"mobile_receipt" in 'File Name'))" always return false, please modify to 

    !IsBlank(LookUp(ThisItem.Notes,"mobile_receipt" in 'File Name').'File Name')

    Another problem is the Base64 string prefix, please change to use "data:image;application/octet-stream;base64," please modify your code as below:

     

     

    If(!IsBlank(LookUp(ThisItem.Notes,"mobile_receipt" in 'File Name').'File Name'),
    Concatenate("data:image;application/octet-stream;base64,", LookUp(ThisItem.Notes,"mobile_receipt" in 'File Name').Document))

     

     

    In the same way:

     

     

    If(!IsBlank(MobileReceiptNote.'File Name'),
    Concatenate("data:image;application/octet-stream;base64,", LookUp(ThisItem.Notes,"mobile_receipt" in 'File Name').Document),
    First(CameraImage).Photo)

     

     

    Snipaste_2020-02-04_14-01-08.png

    Sik

  • Helpful Profile Picture
    382 on at

    Thanks again, @v-siky-msft.  Unfortunately I'm not getting this workaround to function as expected.  I will say that in my tests I was not having any problem with the base64 prefix as shown below:

    test_image_base64.png

    Take a look at this though - this is the request and response shown in Monitor when the LookUp executes in the OnVisible event for the Expense Detail screen:

     

    {
     "url": "https://<someorg>.crm.dynamics.com/api/data/v9.0/msnfpe_expenses%2817663f85-6344-ea11-a812-000d3a579c85%29/msnfpe_expense_Annotations?%24select=annotationid%2Cmimetype%2Cdocumentbody",
     "method": "GET",
     "headers": {
     "Accept": "application/json",
     "Prefer": "odata.maxpagesize=500,odata.include-annotations=*",
     "x-ms-user-agent": "PowerApps/3.20013.29 (Web AuthoringTool; AppName=dc680ca5-ce1f-4afe-b644-98ac6e0b2b0b)",
     "x-ms-client-session-id": "1a71e699-08c1-4331-b4e7-7c1f3133a680",
     "x-ms-client-request-id": "f59af616-24bf-4692-b7d4-6f7aad3efdc2",
     "Request-Id": "f59af616-24bf-4692-b7d4-6f7aad3efdc2",
     "Client-Session-Id": "1a71e699-08c1-4331-b4e7-7c1f3133a680",
     "FormLoadId": "/providers/Microsoft.PowerApps/apps/dc680ca5-ce1f-4afe-b644-98ac6e0b2b0b",
     "Accept-Language": "en-US",
     "Cache-Control": "no-cache, no-store"
     }
    }
    {
     "duration": 846.85,
     "size": 346723,
     "status": 200,
     "headers": {
     "Cache-Control": "no-cache",
     "content-encoding": "br",
     "Content-Length": 346723,
     "Content-Type": "application/json; odata.metadata=minimal",
     "expires": -1,
     "odata-version": 4,
     "preference-applied": "odata.include-annotations=\"*\", odata.maxpagesize=500"
     },
     "body": {
     "@odata.context": "https://<someorg>.crm.dynamics.com/api/data/v9.0/$metadata#annotations(annotationid,mimetype,documentbody)",
     "@Microsoft.Dynamics.CRM.totalrecordcount": -1,
     "@Microsoft.Dynamics.CRM.totalrecordcountlimitexceeded": false,
     "value": [
     {
     "@odata.etag": "W/\"1226155\"",
     "annotationid": "bda7b93b-1645-ea11-a812-000d3a579c98",
     "mimetype": "image/png",
     "documentbody": "iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAgAElEQVR4XpS9B5dkyXUeGOmqunoGwHhvgYEhBVLL1dGvWnFXlAAQAim7f3ZXOgAxM91dXWn3fC7ivqisITdxcKYrzXvxIq75rl/9H//xt5fVetXa+dIu50vbrk5tu9m0zWrdTqdTO7VLw+...<shortened for brevity>"
     },
     {
     "@odata.etag": "W/\"1299696\"",
     "annotationid": "490f6674-b439-9717-904f-7accd1c12039",
     "mimetype": null,
     "documentbody": null
     }

     

    It is returning 2 records with accurate value information, but reporting a total record count of -1!  Is this why IsBlank will always return true?

  • Verified answer
    Helpful Profile Picture
    382 on at

    Found the issue to be the "Explicit column selection" setting.  This setting must have recently been changed (or has a bug) that causes LookUp to no longer return the entire record per spec.

    Turned it off and all is happy.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard