Hello, PowerApps geniuses...
I am having an app crippling issue that appeared out of nowhere and I can't seem to solve it. I have a global variable that is used throughout this app (mainly in all of the components and gallery buttons) called varCurrentItem that assigns the current row number from a gallery and then adds it to a collection referencing a Table variable called varMasterPPE (this used to be a collection variable but for performance reasons I recently changed it to a table variable).
The app will work fine, with no issues then all of a sudden it will randomly flag ~ 3000 formulas with an "incompatible types for comparison error" centered around that varCurrentItem variable... which is set in this line of code (the on-select property of a button inside the gallery):
Set(varCurrentItem, ThisItem.RowNum);
ClearCollect(colCurrentItem, Filter(varMasterPPE, RowNum = varCurrentItem));
This is the code on the items property of the Gallery where the above code resides:
If(varUserInfoSearchTerm, Search(varUserInfoSearch, comAppAssignGallery.galAssignmentsSearchInput, "AdminName", "BranchInventory", "JobNumber", "UserInfoName", "RepairLocation", "RepairReason"),
If(!varMainEditOpen,
Switch(
varUserInfoFilterValue,
"Assign Date", Sort(varUserInfoSearch, DateValue(DateTime), Ascending),
"Branch", Sort(Filter(varUserInfoSearch, BranchInventory), Descending),
"HSE Admin", Sort(Filter(varUserInfoSearch, AdminName), Descending),
"Job Number", Sort(Filter(varUserInfoSearch, JobNumber), Descending),
"Name", Sort(Filter(varUserInfoSearch, UserInfoName), Descending),
"Repair", Sort(Filter(varUserInfoSearch, RepairStatus), Descending),
"Return Date", Sort(varUserInfoSearch, DateValue(RepairReturnDate), Ascending),
"HSE Admin", Filter(Sort(varUserInfoSearch, AdminName, Descending), AdminName),
"Supervisor", Filter(Sort(varUserInfoSearch, UserInfoManagerName, Ascending), UserInfoManagerName),
"Vendor", Sort(Filter(varUserInfoSearch, RepairLocation), Descending),
varUserInfoDefault),
LookUp(varMasterPPE, RowNum = varCurrentItem)
))
In the LookUp function it highlights the = sign and says "Incompatible type, can't compare number, error" which seems to indicate varCurrentItem is in error? but as you can see from the snip below, varMasterPPE has a number in the RowNum Column...
I have tried everything thinking the app is corrupted, backed up, downloaded and re-imported, reverted to earlier versions it will work for awhile and then for no reason spit out the errors again...
Hoping someone has some sort of insight for me??
Thanks in advance as always...
Solved! Go to Solution.
I finally found the issue... where varCurrentItem was contributing as an error (searching through it's variable definitions) I traced it to a separate gallery using the same onselect code in on buttons to select the current items that are stored in another global variable, which I had been setting as blank, all I had to do was populate that variable with data and the issue resolved itself.
Wow, that threw me for a loop! Definitely learned something today though!
Thanks for spending the time, appreciate your efforts!
@Drrickryp Thanks for responding! Yeah, I thought it might just be a type mismatch with value, but that is not the case, as varCurrentItem is currently showing "error, no value", and when I add Value() it just says it's expecting a text or number
But even if I set that variable to a value, it still seems to error out...
I am setting that global variable in multiple galleries on multiple buttons... Could that be an issue for some reason? Note: this is all being done in galleries that exist inside Components
Set(varCurrentItem,ThisItem) should work no matter where it is. It will reset the variable whenever a new Item is selected in a gallery. Make sure it is not referenced in an UpdateContext({... Otherwise I don't know why it is doing that.
I finally found the issue... where varCurrentItem was contributing as an error (searching through it's variable definitions) I traced it to a separate gallery using the same onselect code in on buttons to select the current items that are stored in another global variable, which I had been setting as blank, all I had to do was populate that variable with data and the issue resolved itself.
Wow, that threw me for a loop! Definitely learned something today though!
Thanks for spending the time, appreciate your efforts!
User | Count |
---|---|
258 | |
111 | |
95 | |
48 | |
41 |