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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Data blank in PowerApp...
Power Apps
Answered

Data blank in PowerApps form

(1) ShareShare
ReportReport
Posted on by 776

Created a form to show data from sharepoint list however no data is displayed.

 

I had stored the data into a variable gblCurrentRecordNew and set the value when selecting the item from a gallary. Once the item in the gallary is select it is to display the data in a form.

 

I have set the Item value to be gblCurrentRecordNew but when I enter the code, ThisItem.'Contact Number' no data appears. I am able to print out the data if I type in gblCurrentRecordNew.'Contact Number'.

 

 

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @rpersad 

    It seems like you have correctly stored the selected item from the gallery into the variable gblCurrentRecordNew, and you can even display the 'Contact Number' field's value of the stored item directly using gblCurrentRecordNew.'Contact Number'.

     

    However, within the form, you mentioned using ThisItem.'Contact Number', which is likely causing the issue.

     

    The ThisItem keyword is typically used from controls inside a gallery or a form to refer to the current item or record.

     

    However, in your case, you are using a global variable to store the record and then binding this variable to a form. Therefore, ThisItem doesn't apply here.

     

    Instead of using ThisItem.'Contact Number' in the form, you should use gblCurrentRecordNew.'Contact Number'.

    The form scope should be now the global variable gblCurrentRecordNew since you've set it as its Item property.

     

    I hope this helps @rpersad 

  • rpersad Profile Picture
    776 on at

    The issue I am having with your explanation is I am able to display the sharepoint information on a summary page using the ThisItem function on the form. However when I click a button which navigates to another page to display all the column information the data is blank. Both the summary form and the detailed form uses the same list and item property, "gblCurrentRecordNew".

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @rpersad 

    The problem seems to be related to how Power Apps handles navigation and variable persistence. It could be that when you navigate away from the page where the variable gblCurrentRecordNew is defined, the value might be lost or reset.

     

    When using the Navigate function in Power Apps to move between screens, only certain types of context variables are passed to the new screen. Global variables, like gblCurrentRecordNew, should retain their values across different screens. However, there may be some nuances to how you're handling data that could cause the variable to lose its value.

     

    Here are a few troubleshooting steps:

     

    1. Ensure gblCurrentRecordNew is indeed a global variable and not a local one. Remember, global variables are defined using the Set function, and local variables are defined using the UpdateContext function.

    2. Check the button that navigates to the detailed page. Make sure you're not unintentionally resetting gblCurrentRecordNew during this navigation.

    3. On the detailed page, use a Label control to display the value of gblCurrentRecordNew.'Contact Number'

    This will help to confirm whether the issue is with the form or the variable.

     

    Remember, in the detailed form you should also use gblCurrentRecordNew.'Contact Number' instead of ThisItem.'Contact Number', as the context ThisItem is not available.

     

    You may also want to consider an alternative design approach where you set just the item id and then use the LookUp function to fetch the item again from SharePoint based on this item id. This way, you ensure that the item is fresh and loaded when the detailed screen is shown.

  • rpersad Profile Picture
    776 on at

    Sadly none of the troubleshooting options worked.

     

    Also I do not quite understand the logic given of using the LookUp function instead of just using a global variable, given from what I am understanding is that you are saying data from the variable when passing to different screens can be lost, but even if I store the ID into a variable could not that ID variable also be lost?

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @rpersad 
    No I mean that another formula could be calling Set on gblCurrentRecordNew or otherwise modifying it. For example, if Set(gblCurrentRecordNewGallery1.Selected) is called and no item from the Gallery was selected yet, then gblCurrentRecordNew will be Blank, this is just one example. Check if you are setting gblCurrentRecordNew  to a blank value. Even if you are sure Set(gblCurrentRecordNewyourValue) is correct, it's worth checking the right hand side, yourValue, as it may be a blank value depending on your app and logic. If so, then you would have to correct where that is in your case.

  • rpersad Profile Picture
    776 on at

    Given that I am able to print out the data from the gblCurrentRecordNew variable on the same details screen I know for sure it isnt empty.

  • Verified answer
    rpersad Profile Picture
    776 on at

    Was able to find my issue which was the form was acting as a new form even though it was set as FormMode.Edit.

     

    Could be a bug with PowerApps, but I am not sure.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard