web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SQL Server Views: dupl...
Power Apps
Unanswered

SQL Server Views: duplicating rows

(0) ShareShare
ReportReport
Posted on by 175
Hi,

I hope you can help me, I have a problem with a SQL Server View, PowerApps is duplicating information.

Especially for idDemanda = 7, where the correct is only 4 rows, but it duplicates 3 of them, resulting in a count of 7 rows.
 
Note that when I see the rows through the DataTable it displays only the 4 correct rows, but when I look at the view through the formula bar it shows 7 rows in duplicate.
 
In DataTable Items I'm just inserting the view ('[dbo]. [vwEquipePlanejamento]') without any formula
 
Captura de Tela 2020-11-06 às 13.37.09.png

 

Captura de Tela 2020-11-06 às 13.37.34.png

 

Captura de Tela 2020-11-06 às 13.38.31.png

 

Captura de Tela 2020-11-06 às 13.39.33.png

 

Captura de Tela 2020-11-06 às 13.40.07.png

 

Captura de Tela 2020-11-06 às 13.41.23.png

 


When you launch the app it displays correctly, then changes, but in SQL Server there was no change.

What could be going wrong? how could I solve it?

I look forward to help.

Thanks!
Categories:
I have the same question (0)
  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    Hi @galdezanni 

    The diagnose this, the first thing I would verify is the number of rows that you see from within SQL Server.

    If you go to SQL Management Studio, create a new query, and issue the following SQL, how many rows does this query return? 4 or 7?

    SELECT * FROM [dbo].[vwEquipePlanejamento]
    WHERE idDemanda=7

     

  • galdezanni Profile Picture
    175 on at

    Hi @timl

     

    is with 4 rows

     

    Captura de Tela 2020-11-06 às 15.49.18.png

     

     

  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    Hi @galdezanni 

    As you've confirmed that there are 4 rows in the source SQL database, this is very strange. I can't understand why CountIf would return 7 rows.

    To try and diagnose this further, if you call the filter function and to count the number of number of rows that returns, does that return 4 rows?

    CountRows(Filter('[dbo]. [vwEquipePlanejamento]'; idDemanda = 7))

    If it still returns 7, can you collect the results in a collection like so:

    ClearCollect(colTest; Filter('[dbo]. [vwEquipePlanejamento]'; idDemanda = 7))

    When you do this, can you identify the rows that are duplicated? Can you spot something that might be different about these duplicated rows? Perhaps you could post a screenshot here with the result.

  • galdezanni Profile Picture
    175 on at

    Hi @timl ,

    I did some tests, I didn't identify the reason.

     

    But it starts displaying 7 rows in the formula bar after I select in a gallery on another screen the idDemanda = 7, but I still didn't understand what the relationship would be with the other, even more than in this formula bar it would be showing the information taken from SQL.

     

    Now, it displays the 7 rows in the formula bar (wrongly, since there are only 4 rows in SQL) but it does not display the value 7 in the label, but the 4 (correct), although the account bar still contains the account equal to 7.

     

    I do not understand what can be happening to present so many errors, in my view they do not seem to be errors of the formulas, but - apparently - of the powerapps, which is even more worrying.

     

    galdezanni_0-1604947503821.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard