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.GetDocuments ...
- Here PowerApps wants several attributes.
Would appreciate it if someone could help me.
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 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?
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:
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.
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. 😞
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!