cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Inconsistent behavior between Edit and Play

I have a very simple If statement for the DisplayMode of a button:

 

 

If(IsBlank(gblCurrentShipment.documentation), 
DisplayMode.Disabled, 
DisplayMode.Edit)

 

 

 It works as intended when I am using the application in Edit mode.

However, when I Play the application, gblCurrentShipment.documentation is always blank. This variable is set on the previous screen as follows:

Set(
    gblCurrentShipment,
    LookUp(
        '[dbo].[shipment]',
        id = galShipmentHS.Selected.id
    )
);


Why am I getting different behavior between Play and Edit using the same versions?

This functionality was working fine for weeks previously and nothing was changed on either the app end or the data source end.

2 ACCEPTED SOLUTIONS

Accepted Solutions

If you are getting blank fields in PowerApps (whereas there is data in the datasource) please try turning off 'Explicit Column Selection' in the Advanced settings.

'Explicit Column Selection' guesses which columns your App needs but (in my experience) it doesn't do a very good job. When you are working in the Studio, you may have performed an action that triggers Power Apps to realise that you need that column, but when you run in Play mode, that action has not triggered and so Power Apps does not fetch the column.

In general, I would leave Explicit Column Selection off if you are using SQL as you are probably connecting to normalised tables or views that don't contain many extraneous columns.

'Explicit Column Selection' comes in handy when you are using CDS with standard entities that have a crazy number of fields (something like 180 for Account) and restricting the returned data to only the columns you actually want can yield a significant boost in performance.

View solution in original post

Frequent Visitor

This seems to have done the trick, wasn't even aware of this setting. Thank you!

View solution in original post

5 REPLIES 5
Super User III
Super User III

Hi @jblane ,

There appears nothing wrong with your logic - and the issue (obviously) is why the lookup is not producing data Put a label on the screen with

galShipmentHS.Selected.id

and see if you have an id. Then try

galShipmentHS.Selected documentation

if this field is not already in the gallery data set, include it ( you can also set it off this if present rather then using the lookup).

 

Please click Accept as solution 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 giving it Thumbs Up.

@WarrenBelz 
Thanks for the reply. I did try some of the debugging steps you've mentioned and it seems that everything in the object other than its .documentation property is being pulled back from SQL, so I'm really at a loss as to why it pulls back fine in Edit but not in Play.

@jblane ,

Maybe grasping at straws here, but what type of field is Documentation?

If you are getting blank fields in PowerApps (whereas there is data in the datasource) please try turning off 'Explicit Column Selection' in the Advanced settings.

'Explicit Column Selection' guesses which columns your App needs but (in my experience) it doesn't do a very good job. When you are working in the Studio, you may have performed an action that triggers Power Apps to realise that you need that column, but when you run in Play mode, that action has not triggered and so Power Apps does not fetch the column.

In general, I would leave Explicit Column Selection off if you are using SQL as you are probably connecting to normalised tables or views that don't contain many extraneous columns.

'Explicit Column Selection' comes in handy when you are using CDS with standard entities that have a crazy number of fields (something like 180 for Account) and restricting the returned data to only the columns you actually want can yield a significant boost in performance.

View solution in original post

Frequent Visitor

This seems to have done the trick, wasn't even aware of this setting. Thank you!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,244)