Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Variables not setting for certain records in table

(2) ShareShare
ReportReport
Posted on by 70
Hello all, 
 
I'm banging my head here..  I have five SharePoint lists that contain my data, and I'm creating a collection of each of those lists with their data and am merging those five lists into one master list.

That master list is being used to populate a table. I have a button that sets certain column variables for a selected record, and then simply navigates to a review page where I am then able to submit my patches to SharePoint for updates.

The problem I'm having is that certain records aren't populating the variables, or possibly the variable isn't able to be set with certain records. About half my records are having this issue at the moment.

I've looked at the collections and see no noticeable difference in any of the data points or collections. I'm at a loss as to why table values can be set to variables for some but not all. This is a newer issue that's developed and I'm wanting a list of things to look into since my code treats each record exactly the same.

Here is that code:
Set(varSelectedSourceList, tablePlantingHub.Selected.SourceList);
Set(varSelectedField, tablePlantingHub.Selected.Field);
Set(varSelectedDate, dpPlantingHubDate.SelectedDate);
Navigate('Planting Hub Form');

varSelectedSourceList and var SelectedField are remaining blank in the review page I have with text boxes set to those variables. 
 I've set labels on the table page to tablePlantingHub.Selected.Field and tablePlantingHub.Selected.SourceList and they behave the same way as the text inputs do with being set to varSelectedSourceList and varSelectedField.  Those labels do not populate with certain records. 
 
Other users have the same issue with the same records.  I'm at a loss.  I see nothing wrong with the records in SharePoint that I'm looking up and adding to the collections. 
 
One List is completely fine; anything added to it is able to be populated.  The others are some records will, some won't. 
 
Any ideas on how to troubleshoot further?
  • WarrenBelz Profile Picture
    146,953 Most Valuable Professional on at
    Variables not setting for certain records in table
    OK - SourceList is a field (not a Table) - sometimes names can mislead. I do not use Modern Tables and will leave you with @Michael E. Gernaey. Just note that they are still in Preview and like a lot of other Modern Controls can have bugs.
  • ShanePhillips Profile Picture
    70 on at
    Variables not setting for certain records in table
    Warren, I'm using a table control and it's name is tablePlantingHub.  Items is set to a collection called colPlantMaster.  Selecting an item in the table sets the variable.
     
     
    Michael, I'll do my best here for showing the steps.  I do have labels on the screen and they populate appropriately with the data that works.  We then can navigate to the review page that again has labels showing what data you selected.
    The labels are at the bottom of the screen here:
     
     
    Here is an example of one that does not work and the labels contain nothing.
     
     
    Clicking the Mark as Planted button takes you to the review screen, where again the labels aren't populated if they aren't on the previous screen. In this example they are populated.
     
     
    Here's the SharePoint list, and in this list Field GIDIPU1 works but S2DIPU4 does not.
     
     
     
     
     
  • WarrenBelz Profile Picture
    146,953 Most Valuable Professional on at
    Variables not setting for certain records in table
    I believe I answered an eariler related quesion on this. To help us all here, this line of code
    Set(varSelectedSourceList, tablePlantingHub.Selected.SourceList);
    suggests you are trying to set a Table value out of a record in a gallery or drop-down. That exactly is tablePlantingHub and if a control what is the Items
  • Suggested answer
    Michael E. Gernaey Profile Picture
    42,048 Super User 2025 Season 1 on at
    Variables not setting for certain records in table
     
    Its critical to show us the actual app. With no disrespect meant you have more words than you do information that we can use.
     
    Show your App
    Show an example of a Row you have selected by data isn't populated. You do not need to wait until "After" you do a patch to realize there is no data. Place labels on the screen and have it populate with the data from the select row so you can see what is missing.
     
    Then back track to where you merge your data and verify that that line actually has that data.
     
    Then show us, think of it just as a user would. If a user was trying to explain to you, the  developer what they were doing, you'd want to see a step by step so you can match that to the code etc.
     
    If you can do that for us my friend we can knock this out for you quickly, just always remember, we cannot see what you see and typing your code isn't of much value, we need to see what the code looks like in its location in the Properties you put them in.
     
    Do annotated walkthrough as it sounds like you can repro this pretty easily and we should have you up and running correctly in no time :-)
  • Suggested answer
    EE-04041031-0 Profile Picture
    80 on at
    Variables not setting for certain records in table
    You should use ‘ClearCollect’ since you’re trying to store a table instead of ‘Set’

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 93 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard