web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / when trying to gather ...
Power Apps
Unanswered

when trying to gather a collection inside a gallery each additional row is keeping hidden data from the previous

(0) ShareShare
ReportReport
Posted on by 241

I have some Fill validations on text fields that if blank the fill is yellow, when i fill out the first row inside the gallery and hit the plus to get the next row the fields are blank but the fill is not working.  i have toggled the clear option and can go into the new row and type and clear it then it turns yellow.  what is causing this inside the gallery?

Categories:
I have the same question (0)
  • subsguts Profile Picture
    1,259 Moderator on at

    I think you'll need to give us more information if the community is able to help you.

     

    Suggestions:

    1.  Provide screen shots

    2.  Provide examples of what is in your Fill Property, Items property, etc.

    3.  Explain what how you want it to work.

     

    I think this will get you an answer quickly.

     

    Hope this helps.

  • scottmcnitt Profile Picture
    241 on at

    This is how it should look, but when i add something into the first line and hit the plus to add another item the new item is no longer yellow

     

    scottmcnitt_0-1667330057313.png

     

    scottmcnitt_1-1667330132275.png

    Even though there is nothing in there it thinks there is.  

    This is OnSelect of the plus button

    Collect(colListItems,{intID: GUID()});Defaults(colListItems)

     

    The top half is a form and goes to one list, the bottom half is a gallery and goes to a seperate list but ties to the master ID of the first list.  colListItems is the collection from the gallery. FIN-DETAILS-OSR is the sub list that ties to the main.

    Here is the OnSuccess of submitting the form:

    Collect(
    ValidRows,
    {RowNo: ""}
    );
    Clear(ValidRows);
    ForAll(
    Gallery2.AllItems,
    If(
    !IsBlank(TextInputPurchaseItem.Text) And !IsBlank(TextInputQty.Text) And !IsBlank(DropdownUOM.Selected) And !IsBlank(TextInputLineDesc.Text) And !IsBlank(TextInputVendor.Text) And (TextInputPricePer.Text <> "0"),
    Patch(
    'FIN-DETAILS-OSR',
    Defaults('FIN-DETAILS-OSR'),
    {
    MasterID: OSRForm1.LastSubmit.ID,
    Title: TextInputPurchaseItem.Text,
    Quantity: Value(TextInputQty.Text),
    UoM: DropdownUOM.Selected,
    ItemDescription: TextInputLineDesc.Text,
    PricePerUOM: Value(TextInputPricePer.Text),
    Vendor: TextInputVendor.Text,
    URL: TextInputURL.Text,
    TotalAmount: Value(TotalAmountLine.Text),
    intID: TextInputintID.Text
    }
    );
    Collect(
    ValidRows,
    {RowNo: Text(intID)}
    )
    ));
    If(
    CountRows(ValidRows) <> CountRows(Gallery2.AllItems), NewForm(OSRForm1) And
    Notify(
    "Some of your data has been submitted successfully! Please re-verify yellow highlighted rows; as it contains invalid input.",
    NotificationType.Information
    ),
    Notify(
    "All rows have been submitted successfully!",
    NotificationType.Success
    )
    );
    RemoveIf(
    colListItems,
    intID in ValidRows
    )

  • scottmcnitt Profile Picture
    241 on at

    I have been trying everything i can think of to make this work.  I need some help. It comes down to a gallery with repeating rows and the data going into a collection.  after entering data into the first row and adding a second row, the second row thinks there is data in there and they do not act the same which throws my visual validations off.  I use a fill of yellow to let the end user know that something needs to be filled in, however the second row does not act as if it were blank.  

     

    When the second row drops in is there a way to clear it all for that item?  

  • subsguts Profile Picture
    1,259 Moderator on at

    Hi Scott, sorry for the delay I was hammered by a virus the last 2 days 😞  Will take a look today and try to help the best I can. 

  • subsguts Profile Picture
    1,259 Moderator on at

    Thanks for the details, this helps a lot. Can you provide the following screen shots for the Item Text box.  Please start at the top and do screens shots of everything under the Advanced (see screen shot below).

    The second thing I'd ask to do is search your code for any reference to that text box control.  And provide any code snippets that contain it.

     

    I think with both of these we can figure out where the problem is because either A.  There is something in the properties causing this weird behavior or B.  Somewhere in the code it is triggered this to happen.

     

    subsguts_0-1667570831359.png

  • scottmcnitt Profile Picture
    241 on at

    scottmcnitt_0-1667571605717.pngscottmcnitt_1-1667571621037.pngscottmcnitt_2-1667571636992.pngscottmcnitt_3-1667571651363.png

    scottmcnitt_4-1667571694896.png

     

    This is for the first textbox and the last image is the plus that adds the next row

  • subsguts Profile Picture
    1,259 Moderator on at

    ok, so the key code is the Fill, since that is the only way it can turn yellow:

    If(IsBlank(TextInputPurchase.Text), Yellow, RGB(255,255,255,1))

    This means that TextInputPurchase.Text is Not Blank after you hit the + icon.

     

    You said if you enter something there and clear it turns yelllow.

     

    So, I believe the field is not blank, and probably a NULL value as IsBlank won't evaulate that as true.

     

    Humor me and change the formula in the Fill property to the following:

    If(Len(TextInputPurchase.Text)=0, Yellow, RGB(255,255,255,1))

     

    If this doesn't fix the problem, then, add a label to your gallery and put in it Len(TextInputPurchase.Text), so we can see what it thinks the length is.

    I believe with this information we can get to the solution.

  • scottmcnitt Profile Picture
    241 on at

    scottmcnitt_0-1667574629968.png

    Seems to hold the entry from the first one but doesnt display

  • subsguts Profile Picture
    1,259 Moderator on at

    After you click the + what does the colListItems collection look like?  I assume it has 2 records instead of the 1 that was there before you clicked on the + icon?


  • scottmcnitt Profile Picture
    241 on at

    How can i see what is in the collection?  i go to the data and click on the collection but that does nothing.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard