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 Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,748)