I've spent the last 1.5 working days trying to search the forums, but I am yet to find something that works for me.
I have a collection where I am trying to check whether all IDs in the collection are either the same or blank - if not, then it cannot continue.
The app can consolidate different items together - however, the I'm experiencing is that I cannot figure out how to compare the ConsolidationID to each other.
Example for 3 items:
Title | ConsolidateID
A | ABC
B | ABC
C | CBA
If the button to consolidate these titles together, a notification would appear, but let's say that the ID for C is blank, then it would consolidate the items (the consolidation ID is auto-generated in the app).
I just cannot figure out how to compare all the different IDs to each other.
Any help would be greatly appreciated!
Solved! Go to Solution.
Holy maloney... I asked ChatGDP "check if ID is the same or blank in gallery in Powerapps", which answered the following:
If(CountRows(Filter(Gallery.AllItems, IsBlank(ID) || ID = First(Gallery.AllItems).ID)) = CountRows(Gallery.AllItems), "All IDs are the same or blank", "IDs are not all the same or blank")
The code works, as it now compares all IDs that they are the same, or that they are blank. Here is the code I'm using, which works as it should:
If(
CountRows(
Filter(
Gallery_consolidate.AllItems,
IsBlank(ConsolidatedID) || ConsolidatedID = First(Gallery_consolidate.AllItems).ConsolidatedID
)
) = CountRows(Gallery_consolidate.AllItems),
formula...,
formula....
)
Hi @Bilakanti ,
When using GroupBy (and ClearCollect), I do get the consolidated ID's grouped together, but I'm still not sure how I can compare all the items.
In the example below, there is 1 blank, 2 with the top ID, and 1 with the bottom - I should not be able to consolidate these, as they have to either be the exact ID, or blank.
I guess I could count the number of items in the collection, but if I didn't have any blanks, and two different ID's, it would proceed, when it should not.
Holy maloney... I asked ChatGDP "check if ID is the same or blank in gallery in Powerapps", which answered the following:
If(CountRows(Filter(Gallery.AllItems, IsBlank(ID) || ID = First(Gallery.AllItems).ID)) = CountRows(Gallery.AllItems), "All IDs are the same or blank", "IDs are not all the same or blank")
The code works, as it now compares all IDs that they are the same, or that they are blank. Here is the code I'm using, which works as it should:
If(
CountRows(
Filter(
Gallery_consolidate.AllItems,
IsBlank(ConsolidatedID) || ConsolidatedID = First(Gallery_consolidate.AllItems).ConsolidatedID
)
) = CountRows(Gallery_consolidate.AllItems),
formula...,
formula....
)
User | Count |
---|---|
125 | |
87 | |
84 | |
75 | |
69 |
User | Count |
---|---|
215 | |
179 | |
142 | |
109 | |
83 |