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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Data not loading into ...
Power Apps
Unanswered

Data not loading into local collection on app start

(0) ShareShare
ReportReport
Posted on by
Hi all, 
 
I am fairly new to Power Apps and I am currently trying to build an app to embed into a Power BI report. My current Screen1.OnVisible formula is as follows: 
 
With(
    {
        ctx: PowerBIIntegration.Data
    },
 
// Refresh SQL data
Refresh(fact_cbp_submission);
Refresh(dim_pipeline_type);
Refresh(dim_practice_area);
Refresh(dim_lever);
 
// Load and merge filtered records
    ClearCollect(
        colRows,
        AddColumns(
            fact_cbp_submission,
            PipelineTypeName,
                LookUp(
                    dim_pipeline_type,
                    Value(PipelineTypeID) = Value(ThisRecord.PipelineTypeID),
                    dim_pipeline_type.PipelineType
                ),
            PracticeAreaName,
                LookUp(
                    dim_practice_area,
                    Value(PracticeAreaID) = Value(ThisRecord.PracticeAreaID),
                    dim_practice_area.PracticeArea
                ),
            LeverCategoryName,
                LookUp(
                    dim_lever,
                    Value(LeverCategoryID) = Value(ThisRecord.LeverCategoryID),
                    dim_lever.LeverCategory
                ),
            IsNew, false,
            TempId, Text(Now(), "yyyymmddhhmmssfff")
        )
    )
);
 
but everytime  start the app colRows does not populate and I can't work out why. Can anyone give me some guidance here please? 
Categories:
I have the same question (0)
  • SebS Profile Picture
    4,569 Moderator on at
    Data not loading into local collection on app start
    My guess would be that this is the scoop fault / ThisRecord  try below finger cross it will work
     
    // Load and merge filtered records
        ClearCollect(
            colRows,
            AddColumns(
                fact_cbp_submission As R,
                PipelineTypeName,
                    LookUp(
                        dim_pipeline_type,
                        Value(PipelineTypeID) = Value(R.PipelineTypeID),
                        dim_pipeline_type.PipelineType
                    ),
                PracticeAreaName,
                    LookUp(
                        dim_practice_area,
                        Value(PracticeAreaID) = Value(R.PracticeAreaID),
                        dim_practice_area.PracticeArea
                    ),
                LeverCategoryName,
                    LookUp(
                        dim_lever,
                        Value(LeverCategoryID) = Value(R.LeverCategoryID),
                        dim_lever.LeverCategory
                    ),
                IsNew, false,
                TempId, Text(Now(), "yyyymmddhhmmssfff")
            )
        )
    );
  • WarrenBelz Profile Picture
    152,843 Most Valuable Professional on at
    Data not loading into local collection on app start
    I prepared a response and forgot to post and I see now that @SebS has provided what should be a valid solution (so please mark that). I headed the same direction with a couple of slight variations (the As disambiguation operator is on the "other side" and I also tend to use Lookup( . . . . ).FieldName rather than LookUp( . . . . .,FieldName) when adding columns).
     
    The other issue you may have here is Delegation with the Value() conversions - if they are already numbers, you do not need this (you do if they are Text).
     
    The main reason  (as @SebS pointed out) that ThisRecord may be an issue is that you have identically named fields in the list comparisons (hence the As  operator). Anyway, I might as well post this now I have done it.
    ClearCollect(
       colRows,
       AddColumns(
          fact_cbp_submission,
          PipelineTypeName,
          LookUp(
             dim_pipeline_type As _DPT,
             Value(_DPT.PipelineTypeID) = Value(PipelineTypeID)
          ).PipelineType,
          PracticeAreaName,
          LookUp(
             dim_practice_area As _DPA,
             Value(_DPA.PracticeAreaID) = Value(PracticeAreaID)
          ).PracticeArea,
          LeverCategoryName,
          LookUp(
             dim_lever As _DL,
             Value(_DL.LeverCategoryID) = Value(LeverCategoryID)
          ).LeverCategory,
          IsNew,
          false,
          TempId,
          Text(
             Now(),
             "yyyymmddhhmmssfff"
          )
       )
    );
     
  • Suggested answer
    Inogic Profile Picture
    1,135 Super User 2025 Season 2 on at
    Data not loading into local collection on app start
    Hi,
     
    Add your ClearCollect function in the App.OnStart property, and then select Run OnStart to generate the collection. It will load data into the local collection when the app starts.
     
    Hope this helps.
     
    Thanks!
    Inogic
  • WarrenBelz Profile Picture
    152,843 Most Valuable Professional on at
    Data not loading into local collection on app start
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like â™¥
    Visit my blog
    Practical Power Apps    LinkedIn   

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard