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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Use Data from DocumentDB
Power Apps
Unanswered

Use Data from DocumentDB

(0) ShareShare
ReportReport
Posted on by 11

Hey Community,

 

I'm really struggeling using DocumentDB and PowerApps. I connected my database to PowerApps and now just want to show the documents within a collection. Is there somekind of a instruction? I saw this, but this doesn't help me. Any suggestion :)?

 

- I'm using the vertical gallery

- Tried several things, like 

      - AzureDocumentDB.GetCollection...

      - AzureDocumentDB.GetDocuments ...

          - Here PowerApps wants several attributes.

 

Would appreciate it if someone could help me.

 

Cheers

 

Ben

Categories:
I have the same question (0)
  • Meneghino Profile Picture
    6,949 on at

    Hi @benninyze

    Frankly I have never used DocumentDB but maybe we can solve this with some common sense.

    Since you have managed to connect the database and you have managed to create a vertical custom gallery, then the next logical step would be to set the Items property of the gallery simply to the name of the database as shown in the PowerApps connections.

    What does that give you?

    Then you place controls in the gallery template to show the database fields.

    I hope I can be of more help this time.

  • benninyze Profile Picture
    11 on at

    Hey,

     

    thanks for helping. So I'm trying this right now. 

     

    After I connected to my Azure DocumentDB and inserting a gallery I change the Items function. I want to get the collection 'Contract' with several documents in it.

     

    2017-03-09_11h23_38.png

     

    See, no errors.

     

    Then in the items list itself I try to change the Text function.

     

    For this I'm using the 'attribute' ThisItem. 

     

    2017-03-09_11h26_01.png

     

    I choose for example ThisItem.id. 

     

    I think it is somewhat correct, but it doesn't show me any documents. And yes, in the collection 'Contract' there are several documents.

     

    Anyone facing similar problems? 

     

    Cheers

     

    Ben

     

  • Meneghino Profile Picture
    6,949 on at

    Hi @benninyze

     

    I would suggest to take a step back and create a simple textbox outside the gallery and use the CountRows function to see if you are getting anything returned, something like:

    CountRows(AzureDocumentDB.GetCollection(1;"Contract"))

    If you get 0 or blank then we have a problem to resolve.  If you get 1 or more (hopefully the number of docs you expect) then you can create a button, again outside the gallery, and set its OnSelect property to this:

    ClearCollect(MyTest; AzureDocumentDB.GetCollection(1;"Contract"))

    After you run the app, press the button and return to edit mode, you will be able to inspect the contents of the collection in the Content tab of Studio.

     

    Please let me know how you get on.

  • benninyze Profile Picture
    11 on at

    Thanks! Good point.
    I did CountRows(AzureDocumentDB.GetCollection(1;"Contract")) but get a BLANK value. At least no error. When i missspell Contract I get back an error, so at least this is correct.
    Is it any problem with the rights management?

  • Meneghino Profile Picture
    6,949 on at

    As I mentioned I have no experience with DocumentDB, but at least we have identified the issue.

    Maybe someone else can help further.

  • benninyze Profile Picture
    11 on at

    Little pushing of  topic 🙂

  • Community Power Platform Member Profile Picture
    on at

    Hi,

     

    How did you connect to DocDb, I cant find anything that will work as an acount id ?

     

    Gary

  • Community Power Platform Member Profile Picture
    on at

    Solved my own issue 🙂

  • Community Power Platform Member Profile Picture
    on at

    Hi,

     

    I got a little further, if you set the Gallery date element to 

     

    AzureDocumentDB.GetDocuments("your db", "yourcollection").Documents

     

    Then the gallery populates with the number of documents.

     

    Now I'm stuck on accessing data elements within the doc. 😞

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard