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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Intermittent data loss issue

(0) ShareShare
ReportReport
Posted on by 93
Default:  
If(
    varResNovID = ThisItem.'Objective ID' &&
   (!IsBlank(varResNovValue)|| varResNovValue = "") && Text(ThisItem.Frequency)<>"Quarterly",
    varResNovValue,
    With(
    {
        rec: LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID')
    },
    Switch(
        Text(ThisItem.Frequency),
        "Quarterly",
            Coalesce(
                Text(rec.ResultSep.Text),
                If(
                    Text(ThisItem.Unit) = "text",
                    ThisItem.'Result sep t',
                    If(
                        IsBlank(ThisItem.'Result sep'),
                        Text(ThisItem.itobj_resultsepa),
                        Text(ThisItem.'Result sep')
                    )
                )
            ),
        "Monthly",
            Coalesce(
                Text(rec.ResultNov.Text),
                If(
                    Text(ThisItem.Unit) = "text",
                    ThisItem.'Result nov t',
                    If(
                        IsBlank(ThisItem.'Result nov'),
                        Text(ThisItem.itobj_resultnova),
                        Text(ThisItem.'Result nov')
                    )
                )
            ),
        "Yearly",
            Coalesce(
                Text(rec.ResultNov.Text),
                If(
                    Text(ThisItem.Unit) = "text",
                    ThisItem.'Result nov t',
                    If(
                        IsBlank(ThisItem.'Result nov'),
                        Text(ThisItem.itobj_resultnova),
                        Text(ThisItem.'Result nov')
                    )
                )
            ),
        ""
    )
)
    )
 
Onchange:
 
UpdateContext({
     varResNovValue: Self.Text,
    varResNovID: ThisItem.'Objective ID'
});
If(
    CountRows(Filter(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID')) = 0,
    // Add new record if it doesn't exist
    Collect(
        colRowMonthData,
        AddColumns(
            Gallery2_4.Selected,
            IsChanged,
            1,
            UnitType,
            If(
                IsNumeric(Self.Text) && Text(ThisItem.Unit) <> "text" ,
                1,
                Text(ThisItem.Unit) = "text",
                1,
                IsBlank(Self.Text),
                1,0
            )
        )
    ),
    // Use Patch to update the record if it exists
    Patch(
        colRowMonthData,
        LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID'),
        AddColumns(
            Gallery2_4.Selected,
            IsChanged,
            1,
            UnitType,
            If(
                IsNumeric(Self.Text) && Text(ThisItem.Unit) <> "text" ,
                1,
                Text(ThisItem.Unit) = "text",
                1,
                IsBlank(Self.Text),
                1,0
            )
        )
    )
);
Patch(colObjectivesData,
ThisItem,
{
    'Result nov': If(
                ThisItem.Unit <> Unit.text,
                Value(Self.Text),
                Blank()
            ),
            'Result nov t': If(
                ThisItem.Unit = Unit.text,
                Self.Text,
                Blank()
            )
}
);
If(
    ThisItem.Unit = Unit.text,true, IsNumeric(Self.Text) || IsBlank(Self.Text),true,UpdateContext({varwarningPopup:true})
)
 
 
 
 
when user delete the data in textinput it is reappearing.
I have the same question (0)

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

Coming soon: forum hierarchy changes

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 819 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 308 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 222 Super User 2025 Season 2

Last 30 days Overall leaderboard