Hello,
I have a canvas app that is connected to Dataverse, inside the app I have a gallery that contains multiple projects, in the gallery I have a button that navigates the user to a different screen.
The scenario that I want to achieve:
I want to disable all the buttons only if the data returned in the gallery has a specific flag column (Yes/No) as Yes.
For example, Let's say I have 5 records and the 4th record has the flag column = yes, then all those 5 records should be disabled and not editable.
The formula that I tried:
f(
varcheckinID = 3,
DisplayMode.Edit,
If(
CountRows(
Filter(
'Timesheet Schedules',
'Sched. ID' = ThisItem.'Sched. ID' && TypeFlag = 'TypeFlag (Timesheet Schedules)'.Yes
)
) >= 1,
DisplayMode.Disabled,
DisplayMode.Edit
)
)
Screenshots :
When the flag value is NO for all the projects:
When the flag value of one project is YES I want it to disable the displaymode of all the items :
What should be the updated formula to achieve the above scenario?
Please let me know if you need any further information.
Any help is highly appreciated.
Thank you
Solved! Go to Solution.
This is a scenario where a control outside of the Gallery is a helper. It does not have to be visible.
But, a label outside of the Gallery (let's call it lblTypeCount) with the following Text property formula:
CountRows(Filter(yourGallery.AllItems, TypeFlag = 'TypeFlag (Timesheet Schedules)'.Yes))
Then in your gallery button DisplayMode property formula:
If(IfError(Value(lblTypeCount.Text), 0)>0
Disabled,
Edit
)
That would provide what you need without the cost of doing data filters on each item in your gallery.
I hope this is helpful for you.
This is a scenario where a control outside of the Gallery is a helper. It does not have to be visible.
But, a label outside of the Gallery (let's call it lblTypeCount) with the following Text property formula:
CountRows(Filter(yourGallery.AllItems, TypeFlag = 'TypeFlag (Timesheet Schedules)'.Yes))
Then in your gallery button DisplayMode property formula:
If(IfError(Value(lblTypeCount.Text), 0)>0
Disabled,
Edit
)
That would provide what you need without the cost of doing data filters on each item in your gallery.
I hope this is helpful for you.
User | Count |
---|---|
161 | |
86 | |
71 | |
64 | |
62 |
User | Count |
---|---|
208 | |
149 | |
95 | |
84 | |
66 |