Hello everyone,
I hope all is well,
My Concern:
I have a gallery that displays data from a table in dataverse.
I want to add a blank static item to this gallery, where I'm going to add static text in it.
What I have:
I want to add an additional item to this gallery that does not exist in the filtered table so I can make a pop-up visible whenever it's pressed.
To make things easier, please find below a representation of the additional item that I need to add:
Thus, how this can be done?
Any help would be highly appreciated,
Thank you
I really appreciate your fast response and help @WiZey.
Thank you ๐
I'm glad the problem was spotted quickly!
Let me know if it works fine, or if you need help on something else.
@WiZey, I missed that one ๐.
My filter condition caused the problem, so the solution is to patch the "EmpID" and the "Active" status to the blank record to fix this.
How I manage to do that I'm confuse ๐ **bleep** My Apologies
@SebS I'm afraid you answered to the wrong topic?
@Roberto_el_Hajj Have you tried adding the code below in your "OnSelect" of your button:
ClearCollect(
'Employee Leave Balances Col',
'Employee Leave Balances'
);
Collect(
'Employee Leave Balances Col',
Defaults('Employee Leave Balances')
)
Also, I see some conditions in the "Filter()" you provide to your gallery. I'm guessing this is what is "masking" the blank record because it is filtered out.
Can you try adding another condition to try and keep the blank record? Perhaps something like this:
Filter(
'Employee Leave Balances Col',
'Employee Number'.No = EmpID,Status = 'Status (Employee Leave Balances)'.Active,
IsBlank('Employee Number'.No) //Blank record should have blank number, right?
)
What if create a gallery with Sequance() in its place in Sequence number of Tiles you are looking for and then nest the other gallery in it that means you have a full control and avoid any delegation issues when you use collection keep in mind it can hold only 2000 records.
just an idea
Hi @WiZey , that what i thought too.
In my gallery's Items property, I add the below expression:
Filter(
'Employee Leave Balances Col',
'Employee Number'.No = EmpID,Status = 'Status (Employee Leave Balances)'.Active
)
On a separate button (let's call it button 1), I added the below expression to create the collection:
ClearCollect(
'Employee Leave Balances Col',
'Employee Leave Balances'
)
And it works fine, the collection has been created and the records are being displayed as expected.
No, it shouldn't be related to any required fields. For example, "Defaults()" return a blank item using the rules from the SharePoint list. If you mentioned a default value in a column it should put the default value in the item.
Could you elaborate on which part in didn't work? What errors are you getting?
Let's try step by step.
The formulas I provided should have created a collection from the "Filter()" plus a blank record. Can you confirm the collection works first with the "Filter()" alone, then with "Defaults()" alone, and then both to see if the collection is populated with all the items?
Hello @WiZey, I retested the expression you mentioned above, but it didn't seem to work.
Does it have anything to do with the required fields, or with the lookup even if it makes no sense?
Hello @Roberto_el_Hajj ,
My solution was to store the filtered list in a collection with "ClearCollect()", then add a blank record with a follow-up "Collect()".
ClearCollect(
collection,
Filter(source,...)
);
Collect(
collection,
Defaults(source)
)
The collection will contain all the items from the "Filter()", plus an additional blank record.
Then I added some conditions to the controls inside the gallery to behave differently if the record was blank or not.
Hope this was helpful to you.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,089
Most Valuable Professional