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 / Adding values during i...
Power Apps
Unanswered

Adding values during item update

(0) ShareShare
ReportReport
Posted on by 5,836 Moderator

I am currently doing this to add to an existing cumulative value in a SharePoint list:

 

UpdateIf(DataSource, Title = varRecord.Title,
 {
 DevHours: DevHours + Value(TextInputDevelopmentHours.Text)
 }
)

 

I need to make some changes to my overall formula and would like to use Patch instead to avoid any delegation issues down the line.   It doesn't seem that Patch supports this type of adding values together.

 

Is UpdateIf the only function that allows this?   I would rather avoid a lookup to get the current value if at all possible.

 

 

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

    @JR-BejeweledOne 

     

    what is the datatype for DevHours column? what is the datatype of DevHours parameter that you use to update DevHours column?

  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @JR-BejeweledOne 

    if DevHours parameter just updates the DevHours column value of the item:

     

    ForAll( RenameColumns(Filter(DataSource, Title = varRecord.Title), "ID", "tempID") As ThisItem,
        Patch(DataSource, LookUp(DataSource, ID = ThisItem.tempID),
            {
            DevHours : ThisItem.DevHours + Value(TextInputDevelopmentHours.Text)
            }
        )
    )

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    I have 2 use cases for this.  One uses varRecord.ID (when editing an item) and what you see below is the 2nd use case.   Not sure where the error is, but I *think* it's before the patch as it's not recognizing the data source name at that point.

     

    incompatibletype.png

     

    ForAll(
     RenameColumns(
     Filter(DemoProjectCumulativeHours,
     MasterID = ComboBoxProject.Selected.ID && Title = DevName),
     "MasterID", "tempMID")
     As ThisItem,
     Patch(DemoProjectCumulutiveHours,
     LookUp(DemoProjectCumulutiveHours, MasterID = ThisItem.tempMID),
     {
     DevHours: ThisItem.DevHours + Value(TextInputDevelopmentHours.Text)
     }
     )
     
     )


     

  • Verified answer
    Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @JR-BejeweledOne 

    there is a typo 

    DemoProjectCumulutiveHours
    DemoProjectCumulativeHours

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Thank you!   I am waiting on new glasses and when my eyes get really tired, I miss that sort of thing.............

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard