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

Return data to Powerapps from Azure Cosmos DB

Hi,

My second attempt to post here as my first seems to have disappeared into the ether.

Despite never having used Powerapps or Azure previously I've been tasked by work to evaluate if the combination could be used on a project we have. So as a total newbie I apologise now if my query is inane 🙂

I have an Azure Cosmos DB called CasualWorkerPayments which has a collection called CasualWorkers. There are 2 documents in the collection.

I've created a connection using the Azure Cosmos DB connector.

I have then created a canvas app in Powerapps which contains a datatable. Set the data source as the Azure DB connector.

I thought as an initial test I'd return the document ids to the table. So under the 'items' property I've got 'Table(AzureCosmosDB.GetDocuments("CasualWorkerPayments","CasualWorkers"))'. But nothing is returned to the 'Documents' field.

I've also tried using 'AzureCosmosDB.GetDocuments("CasualWorkerPayments","CasualWorkers")' in the OnSelect property of the 'Documents' field but again no data is returned.

I'm sure I'm missing something quite basic but for the life of me I can't figure it out.

Ultimately, I'd not only return the document ids or names but also query the data in the documents and bring those values into a table as well.

Can anyone please point me in the right direction?

Thanks in advance,

 

Kevin

9 REPLIES 9
Highlighted
New Member

Re: Return data to Powerapps from Azure Cosmos DB

I have the exact same issue.

 

If I try to go for a specific document with something like:

Table(AzureCosmosDB.GetDocument("CasualWorkerPayments","CasualWorkers","MyDocID"))

I just get nothing, eventhough the document contains fields.

Highlighted
Frequent Visitor

Re: Return data to Powerapps from Azure Cosmos DB

I've tried that as well and, like you, nothing gets returned.

 

I'm hoping that it's something that I'm missing as opposed to an issue between powerapps and a cosmos db.

 

This is completely new territory for me. The last few years I've been working with Oracle pl/sql, writing queries, functions and procedures.

 

The closest I've come to developing in this way is working with Oracle forms which uses event driven triggers. But that was a few years ago.

 

Hopefully, someone will come along and point out where we're going wrong 🙂

 

Kevin

 

Highlighted
New Member

Re: Return data to Powerapps from Azure Cosmos DB

According to this post, we should use an Azure Function between the Cosmos DB and the PowerApp: https://sharepointforum.org/threads/using-azure-functions-cosmos-db-and-powerapps-to-build-deploy-an...

I think this approach makes the Cosmos DB connector obsolete and there must be some way of retrieving the data directly via the connector.

Documentation on the subject is scarse. It would be lovely, if a MVP or MS capacity could describe the functionality.
Highlighted
Frequent Visitor

Re: Return data to Powerapps from Azure Cosmos DB

Thanks for that link. I think you're right that the connector is obsolete.

 

Ah well more things to learn. Not sure my 56 year old brain has enough capacity 🙂

 

Kevin

Highlighted
Anonymous
Not applicable

Re: Return data to Powerapps from Azure Cosmos DB

Hi @Kevinh and @Axel666 I'm sorry to hear you're experiencing this issue. While the documentation is quite lengthy, the following link may help:

 

https://www.carlosag.net/PowerApps/Connectors/Azure-Cosmos-DB 

 

If the information provided doesn't help please reply in this thread and I will find a more applicable solution. 

 

@Anonymous

Highlighted
New Member

Re: Return data to Powerapps from Azure Cosmos DB

Hi,

Thanks for looking into this. Unfortunately https://www.carlosag.net/PowerApps/Connectors/Azure-Cosmos-DB does not solve the issue.

Regards
/Axel
Highlighted
Frequent Visitor

Re: Return data to Powerapps from Azure Cosmos DB

Thanks for your suggestion. Unfortunately, it was from this document that I was working. The suggested methods just don't work.

 

Regards,

 

Kevin

Highlighted
Anonymous
Not applicable

Re: Return data to Powerapps from Azure Cosmos DB

In reviewing other posts pertaining to Azure Cosmos DB in the Community I came across this thread. @Axel666 I know you're already aware of this as your replied in that thread as well. I will include the link to the thread below. 

 

https://powerusers.microsoft.com/t5/Creating-Apps/Connecting-to-Azure-Cosmos-DB/m-p/190435

 

@Anonymous

Highlighted
Frequent Visitor

Re: Return data to Powerapps from Azure Cosmos DB

Thanks for the link to that thread. I'll have a closer look at it when I continue my PowerApps review in the new year.

 

Kind regards,

 

Kevin

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,470)