cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kevinh
Level: Powered On

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
Axel666
Level: Powered On

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
Kevinh
Level: Powered On

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

 

Axel666
Level: Powered On

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.
Kevinh
Level: Powered On

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

TopShelf-MSFT
Level 10

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. 

 

@TopShelf-MSFT

Axel666
Level: Powered On

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
Kevinh
Level: Powered On

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

TopShelf-MSFT
Level 10

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

 

@TopShelf-MSFT

Kevinh
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,105)