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 Platform Community / Forums / Power Apps / Retain Previously Patc...
Power Apps
Unanswered

Retain Previously Patched Values in SharePoint List When Updating Specific Columns

(0) ShareShare
ReportReport
Posted on by 136

Hello Community,
I have a power apps, 
My requirement: I have columns with Headers With name 1 to 10,
PrudhviL_0-1713657068007.png
I want to update few columns with different values For that I Built an app with 3 fields (Start Column, End Column, Value)
Lets Say for example I want to Update the columns from 1 to 6 with value '999' and then I want to update values 7 to 10 with '123'

PrudhviL_1-1713657484514.png

 


For this I used formula on the Update Button

ClearCollect(
 colTemp,
 ForAll(
 Sequence(10), // Create a sequence from 1 to 10
 {
 Id: Value,
 Value: If(
 Value(ST_1.Text) <= Value && Value(ET_1.Text) >= Value,
 Value(ValueT_1.Text),
 Blank() // If the condition is not met, store a blank
 )
 }
 )
);
UpdateIf(
 TenderCosting,
 ID = Gallery1.Selected.ID,
 {
 '1': LookUp(colTemp, Id = 1).Value,
 '2': LookUp(colTemp, Id = 2).Value,
 '3': LookUp(colTemp, Id = 3).Value,
 '4': LookUp(colTemp, Id = 4).Value,
 '5': LookUp(colTemp, Id = 5).Value,
 '6': LookUp(colTemp, Id = 6).Value,
 '7': LookUp(colTemp, Id = 7).Value,
 '8': LookUp(colTemp, Id = 8).Value,
 '9': LookUp(colTemp, Id = 9).Value,
 '10': LookUp(colTemp, Id = 10).Value
 }
);


Result: When I try updating the Values I was able to do it for the 1st time then as stated in above example I was able to Patch value from 1 to 6 as '999'. But when I update 7 to 10 as '123', Then I lost the value '999' from 1 to 6 columns.

Could someone please help me with this requirement?
Thanks in advance 
@WarrenBelz 
 @LaurensM 
@Amik 

@DJ_Jamba 

Please Help

@

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    on at
    Re: Retain Previously Patched Values in SharePoint List When Updating Specific Columns

    Hi @PrudhviL ,

     

    Try below formula:

    ClearCollect(
     colTemp,
     ForAll(
     Sequence(10), // Create a sequence from 1 to 10
     {
     Id: Value,
     Value: If(
     Value(ST_1.Text) <= Value && Value(ET_1.Text) >= Value,
     Value(ValueT_1.Text),
     Blank() // If the condition is not met, store a blank
     )
     }
     )
    );
    Patch(
     TenderCosting,
     LookUp(TenderCosting, ID = Gallery1.Selected.ID),
     If(!IsBlank(LookUp(colTemp, Id = 1)),
     {'1': LookUp(colTemp, Id = 1).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 2)),
     {'2': LookUp(colTemp, Id = 2).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 3)),
     {'3': LookUp(colTemp, Id = 3).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 4)),
     {'4': LookUp(colTemp, Id = 4).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 5)),
     {'5': LookUp(colTemp, Id = 5).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 6)),
     {'6': LookUp(colTemp, Id = 6).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 7)),
     {'7': LookUp(colTemp, Id = 7).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 8)),
     {'8': LookUp(colTemp, Id = 8).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 9)),
     {'9': LookUp(colTemp, Id = 9).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 10)),
     {'10': LookUp(colTemp, Id = 10).Value)})
    );

     

    Best regards,

  • PrudhviL Profile Picture
    136 on at
    Re: Retain Previously Patched Values in SharePoint List When Updating Specific Columns

    Thank you @v-jefferni 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard