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 / data not being retriev...
Power Apps
Unanswered

data not being retrieved from data source properly

(0) ShareShare
ReportReport
Posted on by 69

I have a weird situation where data is not being retrieved from data source properly

 

I have the following:

 

Button1:

Set(dynDataSource,Filter('DataSource1',ID=ID))

 

DisplayForm:

 

Datasource: dynDataSource

 

Item:first(dynDataSource)

 

 

When I look at the variable (table) it shows blank data.   If i query the data from sql it shows the record as intended.  I believe I have the same exact setup being used in other apps and can't quite figure out why data is not being returned.  Am I missing something?

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @KUNGFUPANDA559 

    My first guess is this code is causing the issue.  It says when ID it equal to itself (which is always true).

    ID=ID

     

    You will want to compare the ID to some number or variable instead.

     

    ID=1
    ID=myIdNumber

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • KUNGFUPANDA559 Profile Picture
    69 on at

     

    @mdevaney horrible example.  should be ID=textinput1.Text

  • mdevaney Profile Picture
    29,993 Moderator on at

    @KUNGFUPANDA559 

    Hahahaha.

     

    What about changing this

    ID=textinput1.Text

     

    Into this since ID is usually a number type

    ID=Value(textinput1.Text)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • KUNGFUPANDA559 Profile Picture
    69 on at

    The ID field in this case is a unique string.  It's weird the only column of data that is retrieved is the "ID" field.  The ID is correct, but there are about 10 other fields of data that should be returned.  

  • mdevaney Profile Picture
    29,993 Moderator on at
    @KUNGFUPANDA559
    Can you try to Refresh the datasource? Find the datasource in the left menu, click the 3 dots beside it and then click Refresh.

    My theory is changes were made to the database since and it needs to be refreshed.

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up
    .
  • KUNGFUPANDA559 Profile Picture
    69 on at

    refreshing database did not help.  FWIW I'm using an sql on-prem view.  Not sure if behavior changes based on data source.

  • mdevaney Profile Picture
    29,993 Moderator on at

    @KUNGFUPANDA559 

    The behaviour could change based on the datasource but I am not yet ready to call it the cause.  That being said, did you include the primary keys from the source tables?

     

    Another thing to consider is I think a  SQL View is read-only.  Hopefully you do not need it to write data back into the database.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • KUNGFUPANDA559 Profile Picture
    69 on at

    @mdevaney when you ask "did you include the primary keys" are you asking whether or not the datasources have primary keys?  If so, yes they do.  I am also using the primary key as a filtering mechanism.  We're using a view as the intended result is to view a record that exists.  The behavior is so intermittent I'm not sure what the heck i'm doing wrong.

  • mdevaney Profile Picture
    29,993 Moderator on at

    @KUNGFUPANDA559 

    If the behaviour is intermittent I would suggest talking to the forum admins or opening a support ticket 😞

     

    @v-xida-msft

    Any ideas why this might be occuring?

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard