0

I am mostly new to PowerApps but I am creating a stand-alone app that uses Power Automate to upload records to a SharePoint library. I have that working, and on one of the forms I have search functionality so that the gallery is filtered by the value in a few text boxes.

What I want to do is on the form where they upload new records, I want to look up to see if metadata already exists and eventually populate text boxes with the information from those records. Right now I am using a button with this code in the OnSelect event to just find how many records exist with that project number:

Set(varCount, CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )))

I also tried this.

If(CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )) > 0, Set(varCount, 1), Set(varCount,2))

I am getting a warning about large datasets only. However, when I try to run it nothing happens. When I look at the monitor details I get this error first:

"The query is not valid.\r\nclientRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f\r\nserviceRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f"

Then this one:

"Error when trying to retrieve data from the network"

The connection works when I am filtering a gallery, but not when I'm trying to use the count. Does anyone have any idea what is happening?

Thanks!

Brook
  • 21
  • 9

1 Answers1

0

I'm not sure, but I suspect that there's an error in your Filter. The second argument should result in a logical true/false (include the record or not). Yours looks to resolve to a string.

Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )

I think you mean

Filter(ProjectDocuments,'txtProj#'.Text = ProjNum )
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103