Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Use Data from DocumentDB

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.





Community Champion
Community Champion

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.



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.




See, no errors.


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


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




I choose for example 


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? 






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:


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.

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?

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

Maybe someone else can help further.

Little pushing of  topic 🙂

Not applicable



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



Not applicable

Solved my own issue 🙂

Not applicable



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. 😞

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,520)