cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jzcase
Level: Powered On

CDS PowerApp works fine on mobile, but slowly self-destructs in Web browser.

OK so I have a PowerApp that is mostly just a Form that enters new records into a Dynamics CDS entity.

 

OnStart does a ClearCollect from 4 different entities and those Collections are used to populate several dropdowns in the form.

 

The app is rock-solid on PowerApps on my Pixel 3A.

 

In the Web browser, here is what happens:

 

  1. After entering 1-2 logs, the loading dots will appear and continue indefinitely.
  2. After entering 3-4 more logs, the dropdowns no longer populate with the options from the Collections.
  3. Reloading the app restores functionality until 1 & 2 happen again.

While testing this in the Studio, I see that there is nothing wrong with the Collections themselves (I can drop a datasheet and they show the contents of the Collections just fine). And again, there is no issue on mobile (no constant loading dots).

1 ACCEPTED SOLUTION

Accepted Solutions
jzcase
Level: Powered On

Re: CDS PowerApp works fine on mobile, but slowly self-destructs in Web browser.

I think I found the problem.

 

On my ClearCollect for Students, I was doing a filter on a "Two Options" field called "IST". It looked like this:

 

ClearCollect(studentChoice,SortByColumns(Filter(Files,'Resident District'.case_jointagreement='Joint Agreements'.'132220001',IST='IST (Files)'.'1'),"case_name")); // Get list of students

 

Notice the bit in red there. Now when I wrote that, the CDS Connector advised me to pick '0' or '1', presumably because these are the values of those options in that field.

 

One of my users said that she saw the list but it was missing one student. I looked up the student in Dynamics and everything looked fine. I started looking for a bad filter that might be weeding out certains students.

 

When I took a second look at that filter, I noticed that the PowerApps "advisor" thingy was telling me to use 'Yes' or 'No', not '1' or '0'. So when I changed it to 'Yes'---it SEEMS to have fixed everything.

 

Am I crazy? Did the CDS Connector get a revision that changed its preferred convention for Two-Option fields?

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: CDS PowerApp works fine on mobile, but slowly self-destructs in Web browser.

Hi @jzcase ,

 

Can you please share more detailed information about this app? Like the related formulas that you use for the dropdown controls and please explain with the related data types if needed.

 

Also, have you tested with other web browsers and pcs?

 

Regards,

Mona 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jzcase
Level: Powered On

Re: CDS PowerApp works fine on mobile, but slowly self-destructs in Web browser.

Sure. 

 

Also, my users are reporting this problem on both the Web (Chrome) and mobile clients.

 

Here's a screenshot. Student name in the gallery is redacted.

istbuddy.PNG

 

Here is the OnStart code:

Set(currentYear,LookUp(Years,statuscode='Status Reason (Years)'.'1')); // Get the academic year
Set(dateSelected, Today());
Set(firstDay,currentYear.case_firstday); // Get the first day
Set(lastDay,currentYear.case_lastday); // Get the last day
Set(firstYear,Year(firstDay)); // Get the first calendar year
Set(lastYear,Year(lastDay)); // Get the last calendar year
Set(currentUser,User()); // Get the current Office 365 user
Set(currentOwner,LookUp(Users,domainname=currentUser.Email)); //Get the current Dynamics 365 user

/* Initializing lookup fields in CDS entity 'Work Logs' because CDS connector is weird. */

Set(pullWorkTypes,First('Work Logs').case_TypeofWork.case_name);Set(pullWorkTypes,Blank());
Set(pullStudents,First('Work Logs').case_Student.case_name);Set(pullStudents,Blank());
Set(pullSchools,First('Work Logs').case_School.case_name);Set(pullSchools,Blank());
Set(pullDistricts,First('Work Logs').case_District.case_name);Set(pullDistricts,Blank());
Set(pullOwners,First('Work Logs').owninguser.fullname);Set(pullOwners,Blank());
ClearCollect(workLogs,Filter('Work Logs',_ownerid_value=currentOwner,case_servicetype='Service Types'.'132220007',Not(case_worksetting='Work Settings'.'132220002'))); // Get this user's work logs ClearCollect(studentChoice,SortByColumns(Filter(Files,'Resident District'.case_jointagreement='Joint Agreements'.'132220001',IST='IST (Files)'.'1'),"case_name")); // Get list of students ClearCollect(districtChoice,SortByColumns(Filter(Districts,case_jointagreement='Joint Agreements'.'132220001'),"case_alphacode")); // Get list of districts ClearCollect(schoolChoice,SortByColumns(Filter(Schools,case_DistrictId.case_jointagreement='Joint Agreements'.'132220001'),"case_name")); // Get list of schools ClearCollect(worktypeChoice,SortByColumns(Filter('Types of Work',case_servicetype='Service Types'.'132220007'),"case_sortorder",Ascending,"case_name",Ascending)); // Get list of worktypes Set(CASE,LookUp(districtChoice,case_name="CASE")); /* Manually map Option Select choices to values, because CDS connector is weird */ ClearCollect(GroupTypeOptions,{Name:"Classroom - Self Contained",Value:"132220001"},{Name:"Classroom - Resource",Value:"132220002"},{Name:"Classroom - General Ed",Value:"132220003"})

 

The affected dropdowns are actually comboboxes inside of datacards. For example, the "Student" datacard (one of the affected comboboxes) looks like this:

 

istbuddy3.PNG

 

And the ComboBox looks like this (note the red 'x'):

istbuddy4.PNG

 

The red 'x' doesn't throw any errors and it doesn't show up on the error checker. And there's nothing wrong with the studentChoice Collection--see as it shows up just fine in a datatable on a test screen (pardon the heavy redacting).

 

istbuddy5.PNG

 

The issue is intermittent. Half the time it works fine. Example:

 

istbuddy7.PNG

 

And half the time users see this:

 

istbuddy6.PNG

EDIT: Here is the Form submit code:

 

If(Not(DataCardValue30_1.Selected.Value='Work Settings'.'132220001'),

/* If the Work Setting is anything other than "Multiple Students," submit the form */

    SubmitForm(LogForm_1),

/* Otherwise, send the data to the Multiple Student Log Flow */

        UpdateContext({MultiStudentSuccess:'LogMulti-StudentSession'.Run(
        DataCardValue36_1.Selected.case_yearid,                                              // Year
        132220007,                                                                  // Service Type
        DataCardValue9_1.SelectedDate,                                                // Date of Work
        DataCardValue35_1.Selected.case_typeofworkid,                                    // Type of Work
        DataCardValue30_1.Selected.Value,                                             // Work Setting
        LookUp(GroupTypeOptions,Name=Text(DataCardValue1_1.Selected.Value),Value),    // Group Type
        Concat(DataCardValue34_1.SelectedItems,File&"|"),                             // Students
        0,                                                                          // Direct Minutes
        If(Not(IsBlank(DataCardValue10_1.Text)),Value(DataCardValue10_1.Text),0),       // Consult Minutes
        If(Not(IsBlank(DataCardValue19_1.Text)),Value(DataCardValue19_1.Text),0),       // Other Minutes
        If(IsBlank(DataCardValue18_1.Text),                                           // Notes
            Concat(DataCardValue34_1.SelectedItems,Name&", "),
            DataCardValue18_1.Text&"; Students: "&Concat(DataCardValue34_1.SelectedItems,Name&", "))).success}));

/* When the Flow returns Success value, refresh the Work Logs gallery data and reset form */

If(MultiStudentSuccess="true",
    ResetForm(LogForm_1);
    Set(pullWorkTypes,First('Work Logs').case_TypeofWork.case_name);Set(pullWorkTypes,Blank());
    Set(pullStudents,First('Work Logs').case_Student.case_name);Set(pullStudents,Blank());
    Set(pullSchools,First('Work Logs').case_School.case_name);Set(pullSchools,Blank());
    Set(pullDistricts,First('Work Logs').case_District.case_name);Set(pullDistricts,Blank());
    Set(pullOwners,First('Work Logs').owninguser.fullname);Set(pullOwners,Blank());
    ClearCollect(workLogs,Filter('Work Logs',_ownerid_value=currentOwner,case_servicetype='Service Types'.'132220007',Not(case_worksetting='Work Settings'.'132220002')));
    UpdateContext({MultiStudentSuccess:"false"}));

And here is the OnSuccess code for the Form

If(EditMode="edit",Remove('Work Logs',selectedWorklog)); // If the user is editing the log, delete the old log.

/* Reset the form */

UpdateContext({EditMode:"new"});
ResetForm(LogForm_1);

/* Refresh the work log gallery and it's lookups */

Set(pullWorkTypes,First('Work Logs').case_TypeofWork.case_name);Set(pullWorkTypes,Blank());
Set(pullStudents,First('Work Logs').case_Student.case_name);Set(pullStudents,Blank());
Set(pullSchools,First('Work Logs').case_School.case_name);Set(pullSchools,Blank());
Set(pullDistricts,First('Work Logs').case_District.case_name);Set(pullDistricts,Blank());
Set(pullOwners,First('Work Logs').owninguser.fullname);Set(pullOwners,Blank());
ClearCollect(workLogs,Filter('Work Logs',_ownerid_value=currentOwner,case_servicetype='Service Types'.'132220007',Not(case_worksetting='Work Settings'.'132220002')))
jzcase
Level: Powered On

Re: CDS PowerApp works fine on mobile, but slowly self-destructs in Web browser.

I think I found the problem.

 

On my ClearCollect for Students, I was doing a filter on a "Two Options" field called "IST". It looked like this:

 

ClearCollect(studentChoice,SortByColumns(Filter(Files,'Resident District'.case_jointagreement='Joint Agreements'.'132220001',IST='IST (Files)'.'1'),"case_name")); // Get list of students

 

Notice the bit in red there. Now when I wrote that, the CDS Connector advised me to pick '0' or '1', presumably because these are the values of those options in that field.

 

One of my users said that she saw the list but it was missing one student. I looked up the student in Dynamics and everything looked fine. I started looking for a bad filter that might be weeding out certains students.

 

When I took a second look at that filter, I noticed that the PowerApps "advisor" thingy was telling me to use 'Yes' or 'No', not '1' or '0'. So when I changed it to 'Yes'---it SEEMS to have fixed everything.

 

Am I crazy? Did the CDS Connector get a revision that changed its preferred convention for Two-Option fields?

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Kudoed Authors
Users Online
Currently online: 266 members 5,577 guests
Please welcome our newest community members: