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 / Inconsistent Behavior ...
Power Apps
Unanswered

Inconsistent Behavior while saving the multiple records using Powerapps

(0) ShareShare
ReportReport
Posted on by 2

Hi Team,

 

We are facing issues while saving the multiple records, sometimes it is saving and sometimes it is not saving and no error is thrown it's an Inconsistent Behavior while saving the multiple records using Powerapps

 

Please help in resolving this issue..

 

Thanks,

Vidya

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    To help the community understand and help with this issue, can you share a lot more information?:

    • The kind of data source & associated columns you are using
    • Are using using a Form control or Patch()?
    • Can you share the code that is designed to save multiple records?
    • In what ways is the behavior inconsistent? Certain days? Certain records? Certain users?

    The more we know, the better we can get you to a solution quickly.

     

    Regards,

    Bryan

  • vidyavathib Profile Picture
    2 on at

    Thanks for the Response Bryan,

    Below are the details as required..

    Functionality of the page - Each project will have different Phases and the Phases in turn will have multiple checkitems in it.
    When the User adds the phases for his/her projects, automatically the checkitems would get added and then he will update few of the columns (like checkitem,start date, end date ,status etc)with respect to each phase and in some cases also tries to re update the data wrt phases- Here the save functionality is not working as expected

    1.Sharepoint list 
    2.We are using Gallery to display the data (Onvisible of the page) and data is getting loaded via a collection object,  
    And Patch function is used to patch, user entered data to a sharepoint list

    3.Code-
    If(
    LookUp(
    List Name1 //(updated phases details list),
    GlrPhases.Selected.GlrPhaseSprint = SubPhasesName &&
    GlrPhases.Selected.GlrPhaseProjectName = ProjectName.Value && GlrPhases.Selected.GlrPhaseName = PhasesName.Value,
    GlrPhases.Selected.GlrPhaseName = PhasesName.Value
    ),
    ForAll(
    GlrPhaseWise_3.AllItems,
    Patch(
    List Name1 //(updated phases details list),
    LookUp(
    List Name1//(updated phases details list),
    PhasesName.Value = GlrPhasewisePhaseName && ProjectName.Value = GlrPhasewiseProjectName && CheckItem = GlrPhasewiseCheckItem && SubPhasesName = GlrPhaseWiseSubPhaseName
    ),
    {
    SupportingDocuments: supp.Text,
    Observation:obs.Text,
    Status: Dropdown4_3.SelectedText,
    RAGStatus: LblPhaseWiseRAG_3.Text,
    CompletionDate: If(
    Dropdown4_3.Selected.Value = "Closed",
    DatePicker3_6.SelectedDate,
    ""
    ),
    PlannedCompletionDate:
    DatePicker3_7.SelectedDate, 
    Sequence:GlrPhaseWiseSequence,
    Score: score.Text,
    'Compliance status': Dropdown4_4.SelectedText
    }
    )
    ),
    ForAll(
    GlrPhaseWise_3.AllItems,
    Patch(
    List Name1 //(updated phases details list),
    Defaults(List Name1 //(updated phases details list),
    {
    ProjectName: {
    Value: LookUp(
    List Name2(Main list which has all project details),
    ProjectName = GlrPhasewiseProjectName,
    ProjectName
    ),
    Id: LookUp(
    List Name2(Main list which has all project details),
    ProjectName = GlrPhasewiseProjectName,
    ID
    )
    },
    PhasesName: {
    Value : LookUp(
    ListName3(master list which has phases names ),
    PhaseName = GlrPhasewisePhaseName,
    PhaseName
    ),
    Id : LookUp(
    ListName3(master list which has phases names ),
    PhaseName = GlrPhasewisePhaseName,
    ID
    )
    },

    SubPhasesName:LookUp(
    ListName4(Mapping list which has phases added wrt to project),
    Title = GlrPhaseWiseSubPhaseName
    ).Title,
    CheckItem:LookUp(
    ListName5(master list for checkitem wrt to phases)
    CheckItem = GlrPhasewiseCheckItem
    ).CheckItem,
    SupportingDocuments: supp.Text,
    Observation:obs.Text,
    Status: Dropdown4_3.SelectedText,
    RAGStatus: LblPhaseWiseRAG_3.Text,
    CompletionDate: If(
    Dropdown4_3.Selected.Value = "Closed",
    DatePicker3_6.SelectedDate,
    ""
    ),
    PlannedCompletionDate:
    DatePicker3_7.SelectedDate,
    Sequence: GlrPhaseWiseSequence,
    Score: score.Text,
    'Compliance status': Dropdown4_4.SelectedText
    }
    )
    )
    );

    4. When user updates 10-15 rows/records for the first time the data is not getting saved, but for the second time it is getting saved, sometimes  it saves for the first time also (Inconsistent behavior).

  • BCLS776 Profile Picture
    8,994 Moderator on at

    OK, the first thing I did was to format the code using indents and the code sample displayer "</>":

    If(
     LookUp(List Name1, //(updated phases details list)
     GlrPhases.Selected.GlrPhaseSprint = SubPhasesName &&
     GlrPhases.Selected.GlrPhaseProjectName = ProjectName.Value && 
     GlrPhases.Selected.GlrPhaseName = PhasesName.Value,
     GlrPhases.Selected.GlrPhaseName = PhasesName.Value
     ),
     ForAll(GlrPhaseWise_3.AllItems,
     Patch(List Name1, //(updated phases details list) 
     LookUp(List Name1, //(updated phases details list)
     PhasesName.Value = GlrPhasewisePhaseName && 
     ProjectName.Value = GlrPhasewiseProjectName && 
     CheckItem = GlrPhasewiseCheckItem && 
     SubPhasesName = GlrPhaseWiseSubPhaseName
     ),
     {
     SupportingDocuments: supp.Text,
     Observation:obs.Text,
     Status: Dropdown4_3.SelectedText,
     RAGStatus: LblPhaseWiseRAG_3.Text,
     CompletionDate: 
     If(Dropdown4_3.Selected.Value = "Closed", 
     DatePicker3_6.SelectedDate,
     ""
     ),
     PlannedCompletionDate: DatePicker3_7.SelectedDate, 
     Sequence: GlrPhaseWiseSequence,
     Score: score.Text,
     'Compliance status': Dropdown4_4.SelectedText
     }
     )
     ),
     ForAll(GlrPhaseWise_3.AllItems,
     Patch(List Name1, //(updated phases details list)
     Defaults(List Name1),
     {
     ProjectName: 
     {
     Value: 
     LookUp(List Name2,
     ProjectName = GlrPhasewiseProjectName,
     ProjectName
     ),
     Id: 
     LookUp(List Name2,
     ProjectName = GlrPhasewiseProjectName,
     ID
     )
     },
     PhasesName: 
     {
     Value: 
     LookUp(ListName3,
     PhaseName = GlrPhasewisePhaseName,
     PhaseName
     ),
     Id: 
     LookUp(ListName3,
     PhaseName = GlrPhasewisePhaseName,
     ID
     )
     },
     SubPhasesName: 
     LookUp(ListName4,
     Title = GlrPhaseWiseSubPhaseName
     ).Title,
     CheckItem: 
     LookUp(ListName5,
     CheckItem = GlrPhasewiseCheckItem
     ).CheckItem,
     SupportingDocuments: supp.Text,
     Observation:obs.Text,
     Status: Dropdown4_3.SelectedText,
     RAGStatus: LblPhaseWiseRAG_3.Text,
     CompletionDate: 
     If(Dropdown4_3.Selected.Value = "Closed",
     DatePicker3_6.SelectedDate,
     ""
     ),
     PlannedCompletionDate: DatePicker3_7.SelectedDate,
     Sequence: GlrPhaseWiseSequence,
     Score: score.Text,
     'Compliance status': Dropdown4_4.SelectedText
     }
     )
     )
    );
    

    Perhaps this happened when you inserted comments, but there were 4 or 5 critical syntax errors (missing commas, extra parenthesis) that should've resulted in Power Apps displaying errors. I think I caught all those. This format helps when reviewing nested records too.

     

    The very first problem is the condition on the main If() statement. The condition is simply a LookUp() and should be showing an error - this needs to be an expression that evaluates to true or false. If you are trying to test whether a record exists using that LookUp, then you should evaluate its return value using the IsBlank() function to return a true or false.

     

    Second, I noticed the same LookUp() at the start of the code has a mixture of && and separate lookup arguments - is there a reason for this?:

    If(
     LookUp(List Name1, //(updated phases details list)
     GlrPhases.Selected.GlrPhaseSprint = SubPhasesName &&
     GlrPhases.Selected.GlrPhaseProjectName = ProjectName.Value && 
     GlrPhases.Selected.GlrPhaseName = PhasesName.Value,
     GlrPhases.Selected.GlrPhaseName = PhasesName.Value
     ),

     

    I suggest correcting those issues before going further into the functionality of the code.

    Bryan

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard