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

What's the issue here? Trying to update a gallery filter and it causes an error with a variable so I have to rename the variable throughout the whole app??

The app record navigator is on the right.  The commitments are grouped by Type and the label shows the name.  OnSelect runs a lookup to set the form records: 

jzy5282_0-1656861175298.png

 

These are the item in the gallery:

Filter(Commitments, 'Commitment Item'=ThisItem.CommitmentItem)

 

These are the items of the parent Gallery: 

 

AddColumns(
    GroupBy(
        Commitments,
        "CommitmentItem",
        "ByName"
    ),
    "Count",
    CountRows(ThisRecord.ByName)
)

 

This is the on select 

 

Set(varComit, ThisItem); Set(UserRecordResult, LookUp(Agreements,Title=varComit.FK_Agmt_Cmit.Value)); UpdateContext({cmitSource: true});


Concurrent(
Set(varlhdr, First(Filter(LineHeaders, FK_Cmit_Lhdr.Value=varComit.Title))),
ClearCollect(collhdrs, Filter(LineHeaders, FK_Cmit_Lhdr.Value=varComit.Title)),
ClearCollect(collhdrsC, Filter(LineHeaders, FK_Cmit_Lhdr.Value=varComit.Title)),
ClearCollect(colfyrs, Filter(FiscalYearDetails, FK_Agmt_Fyds.Value=UserRecordResult.Title)),
ClearCollect(colfyrsC, Filter(FiscalYearDetails, FK_Agmt_Fyds.Value=UserRecordResult.Title)),
ClearCollect(fyex, Filter(Fydextended, FK2_Cmit_ID=varComit.ID));
);

 

 

.... Now if I try to change the filter of the nested gallery, varComit is set to error and the whole app turns RED.  If I try to undo set it back, it doesn't fix the issues.  Nor does restoring an earlier version.  The only way I've been able to fix it is rename the variable through out the whole app which is a HUGE pain.  What's the issue and how can I avoid this problem.  

 

After trying to add a filter to nested gallery 

 

jzy5282_2-1656861532665.png

Filter on nested gallery before: 

Filter(Commitments, 'Commitment Item'=ThisItem.CommitmentItem)

Tried to change it to: 

Filter(Commitments, 'Commitment Item'=ThisItem.CommitmentItem, Awardee = "John")

Let me know if you need anymore detail from the app.  Thanks.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jzy5282
Frequent Visitor

So i figure out that if I 

1. Rename the varCmit variable throughout the app, then

2. Filter at the parent gallery level, then no issues.

Also, if there isn't a nested gallery:

1. Before making changes to the Items: 

 - comment out the onselect so it doesn't affect the variable

2. make the changes and confirm they are compatible with the variable. 

3. Once it's good, go to onselect and uncomment the formula

Again, no issues. 

View solution in original post

1 REPLY 1
jzy5282
Frequent Visitor

So i figure out that if I 

1. Rename the varCmit variable throughout the app, then

2. Filter at the parent gallery level, then no issues.

Also, if there isn't a nested gallery:

1. Before making changes to the Items: 

 - comment out the onselect so it doesn't affect the variable

2. make the changes and confirm they are compatible with the variable. 

3. Once it's good, go to onselect and uncomment the formula

Again, no issues. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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