cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianHFASPS
Level 8

Trying to edit a formula breaks Collection everywhere in app?

I have this Item definition for a Gallery in my app:

 

Sort(Search(Filter(LocalStuList, 'Grade Sort' < 6), 'Camp Roster Student Name Input'.Text, "Student_x0020_First_x0020_Name", "Student_x0020_Last_x0020_Name"), 'Student Last Name', Ascending)

I wanted to edit it to:

 

 

Sort(Search(LocalStuList, 'Camp Roster Student Name Input'.Text, "Student_x0020_First_x0020_Name", "Student_x0020_Last_x0020_Name"), 'Student Last Name', Ascending)

The problem is as soon as I edited the line every reference to LocalStuList in my app broke. I have to close app editing and re-open to fix. Even it undo the edit. Maybe a bug?

 

 

6 REPLIES 6
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Trying to edit a formula breaks Collection everywhere in app?

Hi Brian,

In every location where you collect to LocalStuList, do they use the exact same columns or does it change in any place? Can you share some examples?

BrianHFASPS
Level 8

Re: Trying to edit a formula breaks Collection everywhere in app?

Just as a test I broke the list used by this screen apart from others I now have this:

Sort(Search(CampStuList, 'Camp Roster Student Name Input'.Text, "Student_x0020_First_x0020_Name", "Student_x0020_Last_x0020_Name"), 'Student Last Name', Ascending)

It is built only by once in the app:

ClearCollect(CampStuList, LocalStuList)

Which is only built by once in the app:

ClearCollect(LocalStuList, '[dbo].[StuListSmall]')

I can clear all the errors by closing app and re-opening it. By simply changing one charater and then undoing change it won't clear all the errors.

PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Trying to edit a formula breaks Collection everywhere in app?

Are you setting any contents of the collections to variables?

 

And can you retrieve a session id for situations like this involving the flow of data?

https://aka.ms/pa/sessionid

BrianHFASPS
Level 8

Re: Trying to edit a formula breaks Collection everywhere in app?

Session ID: 2c2e1785-d29d-48f5-987c-9a3618d4aae1
PowerApps 3.19034.12

I am transfering certain columns from one collection to another and adding columns along the way via this code:

Collect(
    CampRoster,
    {
        Grade: ThisItem.Grade,
        'Grade Sort': ThisItem.'Grade Sort',
        'Student Last Name': ThisItem.'Student Last Name',
        'Student First Name': ThisItem.'Student First Name',
        'User ID': ThisItem.'User ID',
        Morn: false,
        After: false
    }
);
If(
    CountRows(
        Filter(
            CampStuList,
            Student_x0020_Last_x0020_Name = ThisItem.'Student Last Name'
        )
    ) <= 1,
    Reset('Camp Roster Student Name Input')
);
Remove(
    CampStuList,
    ThisItem
)

Probably not the most elegant way to do it, but I couldn't figure out how else to do it.

PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Trying to edit a formula breaks Collection everywhere in app?


@BrianHFASPS wrote:
Session ID: 2c2e1785-d29d-48f5-987c-9a3618d4aae1
PowerApps 3.19034.12

I am transfering certain columns from one collection to another and adding columns along the way via this code:

Collect(
    CampRoster,
    {
        Grade: ThisItem.Grade,
        'Grade Sort': ThisItem.'Grade Sort',
        'Student Last Name': ThisItem.'Student Last Name',
        'Student First Name': ThisItem.'Student First Name',
        'User ID': ThisItem.'User ID',
        Morn: false,
        After: false
    }
);
If(
    CountRows(
        Filter(
            CampStuList,
            Student_x0020_Last_x0020_Name = ThisItem.'Student Last Name'
        )
    ) <= 1,
    Reset('Camp Roster Student Name Input')
);
Remove(
    CampStuList,
    ThisItem
)

Probably not the most elegant way to do it, but I couldn't figure out how else to do it.


This is the likeliest culprit. Can you paste the exact error you're getting?

 

My hunch is there is a data-type mismatch or different number of columns somewhere that causes things to break. I would go through the app and make sure collections of the same table are the same shape and have columns of exact same data types.

BrianHFASPS
Level 8

Re: Trying to edit a formula breaks Collection everywhere in app?

I don't think you understood my issue. This is a transient issue. If I edit that line it throws a bunch of errors. Then if I put it back it doesn't clear them. I can literally delete one character and type it right back and the errors created by deleting that character won't clear. Then if I close editing of app and re-open it all the errors are gone. It isn't a problem with code it is that the editor doesn't realize I have fixed the code until I totally close app and re-open. I can send a video to show it. I tried with GIF in first post but it turned out too small.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,008)