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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multiple rows created ...
Power Apps
Answered

Multiple rows created when trying to add or delete rows

(0) ShareShare
ReportReport
Posted on by 480

Hi Team,

I have a Sharepoint List linked to Powerapps. I have a repeating table in it.

When I add a new list item along with the rows in it. 2 list items are created in the SharePoint List.

When I remove the rows, additional row is created with the deleted one.

 

Please help. I am truely in need of guidance. Please do respond.

 

cyberco01_0-1634447437743.png

 

cyberco01_2-1634447500783.png

 

 

 

Thanks,

Categories:
I have the same question (0)
  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @cyberco01 

     

    Can you post your currant formula so we can amended

  • cyberco01 Profile Picture
    480 on at

    @Ramole 

    OnSave:
    -------
    Set(
    AllPurchasesString,
    Concat(
    Gallery1.AllItems,
    Concatenate(
    txtSrNo.Text,
    "; ", ComboBox3.Selected.PERSONNELNUMBER,
    //txtEmpNo.Text,
    "; ", //ComboBox3.Selected.NAME,
    txtEmpName.Text,
    "; ",
    txtPosition.Text,
    " | "
    )
    )
    );
    Patch(
    BonusRequests,
    Defaults(BonusRequests),
    {
    //Title: Text(Today()),
    //RepeatingSection: AllPurchasesString
    Title: DataCardValue1.Text,
    ProjNo: ComboBox1.Selected.PROJECTID,
    MonthName:DataCardValue3.Selected,
    RepeatingSection: AllPurchasesString
    }
    );
    Notify(
    "Record Submitted Succesfully!",
    NotificationType.Success
    );
    Refresh(BonusRequests);
    RequestHide()

     

    OnEidt:
    -------
    Refresh(BonusRequests);
    EditForm(SharePointForm1);
    Set (RepSecCOllString, LookUp( BonusRequests, ID=SharePointIntegration.SelectedListItemID, RepeatingSection));Clear (InvoiceCollection);
    Set (EditRepSecStr,LookUp( BonusRequests, ID=SharePointIntegration.SelectedListItemID , RepeatingSection));Set(EditRepSecStr,Left(EditRepSecStr,Len(EditRepSecStr) - 1));
    ForAll (
    Split (
    EditRepSecStr,
    "|"
    ),
    Collect (
    InvoiceCollection,
    {
    lblSrNo: Text (Last (FirstN(Split(Result,";").Result,1).Result).Result),
    txtEmpNo: Text (Last (FirstN(Split(Result,";").Result,2).Result).Result),
    txtEmpName: Text (Last (FirstN(Split(Result,";").Result,3).Result).Result),
    txtPosition: Text (Last (FirstN(Split(Result,";").Result,4).Result).Result)
    }
    )
    )

    OnView:
    -------
    Refresh(BonusRequests);
    ViewForm(SharePointForm1);
    Set (RepSecCOllString, LookUp( BonusRequests, ID=SharePointIntegration.SelectedListItemID, RepeatingSection));Clear (InvoiceCollection);
    Set (EditRepSecStr,LookUp( BonusRequests, ID=SharePointIntegration.SelectedListItemID , RepeatingSection));Set(EditRepSecStr,Left(EditRepSecStr,Len(EditRepSecStr) - 1));
    ForAll (
    Split (
    EditRepSecStr,
    "|"
    ),
    Collect (
    InvoiceCollection,
    {
    lblSrNo: Text (Last (FirstN(Split(Result,";").Result,1).Result).Result),
    txtEmpNo: Text (Last (FirstN(Split(Result,";").Result,2).Result).Result),
    txtEmpName: Text (Last (FirstN(Split(Result,";").Result,3).Result).Result),
    txtPosition: Text (Last (FirstN(Split(Result,";").Result,4).Result).Result)
    }
    )
    )

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @cyberco01 

     

    Is late for me here, will check it tomorrow but at moment try this

     

    ForAll(
     AllPurchasesString, 
     Patch(
     BonusRequests, 
     Defaults(BonusRequests),
     {
    
    //Title: Text(Today()),
    //RepeatingSection: AllPurchasesString
    Title: DataCardValue1.Text,
    ProjNo: ComboBox1.Selected.PROJECTID,
    MonthName:DataCardValue3.Selected,
    RepeatingSection: AllPurchasesString
    }
    );
    Notify(
    "Record Submitted Succesfully!",
    NotificationType.Success
    );
    Refresh(BonusRequests);
    RequestHide()

     

     

  • cyberco01 Profile Picture
    480 on at

    @Ramole This did not work.

    Now while saving, 2 list items are not created. However, while deleting a row from the repeating table. additional list item is created.

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @cyberco01 

     

    As it shows not the formula i provied you is working correctly not adding Multiple so now you will need to modify the other 

  • cyberco01 Profile Picture
    480 on at

    @Ramole how to correct the code so that while deleting rows in the repeating rows of an existing list, new list is not created.

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @cyberco01 

     

    Outside button and will delete any item(s) selected from gallery checkbox

    Remove(
     Splist,
     colSelected
    );
    Notify(
     "Records Deleted Successfully",
     NotificationType.Success
    );
    Clear(colSelected);
    Reset(checkbox)

     Add a check box inside the gallery - 

    OnCheck of check box add this 

    Collect(colSelected,ThisItem)

     

    OnUncheck

     

    Remove(colSelected,ThisItem)

     

    You can even make the delete button disappear if nothing is selected by adding this code on  Visible

     

    Visible of the delete button outside 

    CountRows(colSelected)>0

     

     

     

     

     


     

  • cyberco01 Profile Picture
    480 on at

    @Ramole ,

    My form looks like below. Therefore, where should I add the Outside button code.

    cyberco01_0-1634536087103.png

     

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @cyberco01 

     

    Anywhere even on the top and test it 

  • cyberco01 Profile Picture
    480 on at

    @Ramole I am getting an error in the Remove part,

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 463

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
11manish Profile Picture

11manish 275

Last 30 days Overall leaderboard