cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KUNGFUPANDA559
Helper II
Helper II

data not being retrieved from data source properly

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?

9 REPLIES 9
mdevaney
Super User
Super User

@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."

 

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

@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."

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.  

@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
.

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

@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."

@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.

@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?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,446)