I am trying to count empty rows in a gallery but it returns false when all rows are empty, what am i missing?
i also want to patch only the rows that have data to my source.
This is my gallery:
To count the empty rows:
I applied the following formula on a text label:
@Sundeep_Malik yes i tried this but it doesn't give me the desired output. as seen in the screenshot, the comments column is empty but it returns false instead of true.
first, i am trying to test for blank columns
then, i am trying to count how many rows in the gallery are blank
finally, i am trying to patch the non-blank rows to my datasource.
Here are a couple of things to try:
1) try using IsBlankOrError() instead of IsBlank() to see if that gives you the desired results.
2) If you are using a Collection to populate your Gallery, then try the following:
a) when you load your Source Collection, also create a copy called colEdit.
b) add a new Column to the colEdit collection named "Updated" and set the default value to 0.
c) for the OnChange event of your controls in the Gallery Template, use a Patch statement on the colEdit Collection to update the column/field that is changed and set the "Updated" column to 1.
d) Assuming you have a button or something similar to kick off the row updates to your data source, filter the colEdit Collection using "Updated" = 1.
This should allow you to only update/patch your data source with the changes that have been made.
Assumptions: Your Source Collection has a unique identifier so that ThisItem.ID or something similar would be valid.
You might be wondering "why use two collections? Just added the Updated field to a single collection." In my use of Galleries and Collections, I have found that having a Source collection and an Edit Collection allows things to work as expected. If you Patch the Source Collection with updates, you sometimes end up with a Refresh on the Gallery with unintended results. Note: You can use a Collect statement on your Source and Edit Collection to add a new row/item and that does not cause a Refresh issue (for whatever reason).
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!