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 Query in Power app...
Power Apps
Answered

SQL Query in Power apps, power apps slow, gallery design breaking

(0) ShareShare
ReportReport
Posted on by 8

Hi

I am trying to PowerApps canvas application.. I have no experience with power apps. SQL server is using with power apps.

I am facing a lot of issues.

1. My app is  very slow, it takes more than 1 mint to fetch and display data. My data fetching way is may be incorrect.

 

I am attaching my sql query, i am trying write PowerApps query for this one

 

Select br1.[BrandBriefId],br1.[CountryId],br1.[ScenarioId],br1.[SKUNo],
br2.SPCName,br2.BUId,br3.SPCRefNo,Br3.MaterialCode,br3.FGroupId,f1.FGroupName,c1.CountryName,br2.BrandBriefStatus
From [BrandBriefCountryWise] br1
join [BrandBrief] br2 on br1.[BrandBriefId]=br2.BrandBriefId
join [BrandBriefDetails] br3 on br3.BrandBriefId=br1.BrandBriefId
join FGroup f1 on f1.FGroupId=br3.FGroupId
join Country c1 on c1.CountryId=br1.CountryId
where br2.BrandBriefStatus>1

 

 

my power apps query

 

colSFCViewOpentasks is used as the datsource

 

ClearCollect(colSFCViewOpentaskstemp,
ShowColumns(
AddColumns(
BrandBriefScenarios,
"SPCRefNo",LookUp(BrandBriefDetails, BrandBriefId = BrandBriefScenarios[@BrandBriefId], SPCRefNo),
"CurrentSKUNo",LookUp(BrandBriefDetails, BrandBriefId = BrandBriefScenarios[@BrandBriefId], SKUNo),
"SPCName",LookUp(BrandBrief, BrandBriefId = BrandBriefScenarios[@BrandBriefId], SPCName),
"SPCType",LookUp(BrandBrief, BrandBriefId = BrandBriefScenarios[@BrandBriefId], SPCType),
"RequestType",LookUp(BrandBrief, BrandBriefId = BrandBriefScenarios[@BrandBriefId], RequestType),
"CreatedDate",LookUp(BrandBrief, BrandBriefId = BrandBriefScenarios[@BrandBriefId], CreatedDate),
"SKU",LookUp(BrandBrief, BrandBriefId = BrandBriefScenarios[@BrandBriefId], SKU),
"FGroupId",LookUp(BrandBriefDetails, BrandBriefId = BrandBriefScenarios[@BrandBriefId], FGroupId),
"BUId",LookUp(BrandBrief, BrandBriefId = BrandBriefScenarios[@BrandBriefId], BUId),
"BrandBriefStatus",LookUp(BrandBrief, BrandBriefId = BrandBriefScenarios[@BrandBriefId], BrandBriefStatus)
),
"BrandBriefId","ScenarioId","ScenarioNo", "SPCRefNo","CurrentSKUNo", "SPCName","SPCType","RequestType",
"CreatedDate","SKU","FGroupId","BUId","BrandBriefStatus")
);


ClearCollect(colSFCViewOpentasks_last,
AddColumns(
colSFCViewOpentaskstemp,
"FGroupName",LookUp(FGroup, FGroupId = colSFCViewOpentaskstemp[@FGroupId], FGroupName),
"BUName",LookUp(BUMaster, BUId = colSFCViewOpentaskstemp[@BUId],BUName)
)
);


ClearCollect(
colSFCViewOpentasks,
Filter(colSFCViewOpentasks_last, BrandBriefStatus>1 )
);

 

 

2. I am using gallery control, while developing the gallery it shows correctly but after publish its design is breaking. I added horizontal scroll bars, they didn't showing, my columns not fully showing . In another gallery full data source contain 15 data, while checking in development 15 data are coming but after publish some data are not showing only 7 record is showing. I am not understanding what am I doing wrong and where I fix?

 

in publish files designs are breaking

 

list 2.PNG

 

lin image list 2.png.(I run in development- edit-run). here my horizontal scroll bars  are fully showing , and my columns are fully showing, but in published file (in some system) it  breaks full columns are not showing.

 

 

Categories:
  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    @monikaprakash_1 

     

    The answer to this is to create a SQL Server view and to connect to that view from your app.

     

    CREATE VIEW viewSFCViewOpentasks
    AS
    Select br1.[BrandBriefId],br1.[CountryId],br1.[ScenarioId],br1.[SKUNo],
    br2.SPCName,br2.BUId,br3.SPCRefNo,Br3.MaterialCode,br3.FGroupId,f1.FGroupName,c1.CountryName,br2.BrandBriefStatus
    From [BrandBriefCountryWise] br1
    join [BrandBrief] br2 on br1.[BrandBriefId]=br2.BrandBriefId
    join [BrandBriefDetails] br3 on br3.BrandBriefId=br1.BrandBriefId
    join FGroup f1 on f1.FGroupId=br3.FGroupId
    join Country c1 on c1.CountryId=br1.CountryId
    where br2.BrandBriefStatus>1
    
    

     

    Whilst your Power Apps query/formula maybe syntactically correct, it's impossible to make it performant with that number of LookUps.

     

    By improving the performance by using a view, it should hopefully help resolve the issue of the missing data in your gallery control. If not, report back here on what happens.

     

  • monikaprakash_1 Profile Picture
    8 on at

    thankyou 🙂 

    I changed to sql views, Now design issues solved, loading solved.. 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard