Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Only have updated records show as 'Yes' in email

(1) ShareShare
ReportReport
Posted on by 67
Hello,
I'm having some trouble with my app. My app, if a record field matches the column 'Helper', takes the user to an 'Update' screen. The goal with the Update screen is to update a record if a match between the Helper column in Table1 and the Helper column in the collection is found. If not, it patches a new record to the data source/table (I'm using Excel). 
 
The problem: I'm trying to use UpdateIf to change the collection 'Revised' field to 'yes' if there's a match. However, when I use UpdateIf, it's updating ALL records in the collection Revised column to 'yes', (or in this case 'lasttest') not just the updated record. It shows up as:
Is it possible to have it so only the revised records show as 'yes' and the new records be blank/left alone? 
Any help is greatly appreciated.
 
Below is the code:
ForAll(
    collection1,
    If(
        IsBlank(LookUp(Table1, Helper = collection[@Helper])),
        Patch(Table1, Defaults(Table1),  {'BOL No': collection1[@'BOL No'],
        'Arrival Time': collectionname[@'Arrival Time'], 
        'Branch No':  collectionname[@'Branch No'], 
        'Date Received': collectionname[@'Date Received'],
        'Delivery Quality':  collectionname[@'Delivery Quality'],
        'Departure Time':  collectionname[@'Departure Time'],
        'Point of Contact':  collectionname[@'Point of Contact'],
        'Notification of Late Delivery via':  collectionname[@'Notification of Late Delivery via'],
        'Master Load ': collectionname[@'Master Load '],
        'Issue Code': collectionname[@'Issue Code'],
        'Item ID Ordered':  collectionname[@'Item ID Ordered'],
        'Item ID Shipped':  collectionname[@'Item ID Shipped'],
        'Qty Ordered':  collectionname[@'Qty Ordered'],
        'Qty Received': collectionname[@'Qty Received'],
        'Qty Shipped':  collectionname[@'Qty Shipped'],
        'Damage Description': collectionname[@'Damage Description'],
        Helper:  collectionname[@Helper],
        'Service Failure': collectionname[@'Service Failure'],
        'Customer Failure': collectionname[@'Customer Failure'],
        XFRNo:  collectionname[@XFRNo],
        Comments: collectionname[@Comments],
        Revised: ""
        }),
        Patch(Table1, LookUp(Table1, Helper = collectionname[@Helper]), ThisRecord, {Revised: "Yes"})
    )
)
; UpdateIf(Table1, Helper in collectionname[@Helper], {Revised: "Yes"});
 
  • Verified answer
    kona134 Profile Picture
    67 on at
    Only have updated records show as 'Yes' in email
    Hi,
    Firstly, thank you for the help! After doing some research and more fiddling around with it, I got the answer from Matthew Devaney's site. For me, this looked like the following:
    ForAll(
        Filter(collectionname, collectionID in Table1.ID),
        Patch(collectionname, ThisRecord, {columnname: "value"})
    )
    Now the emails work as expected and look like this:

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Only have updated records show as 'Yes' in email
    Hi kona134 
    Firstly Excel is a terrible data source and some things that should work simply do not, although your query
    Helper in collectionname[@Helper]
    presents further challenges as Excel will not execute it (the in FIlter is not supported). If you had a unique identifying field in your Table and your Table numbers are under your Data Row Limit, this rather clunky workaround may do the job
    With(
       {_Data: Table1},
       With(
          {
             _Records:
             Filter(
                _Data,
                Helper in collectionname[@Helper]
             )
          },
          ForAll(
             _Records As _R,
             Patch(
                Table1,
                Lookup(
                   Table1,
                   YourIDField = _R.YourIDField
                ),
                {Revised: "Yes"}
             )
          )
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,017 Most Valuable Professional

Leaderboard