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 / Update collection from...
Power Apps
Unanswered

Update collection from drop-down ONLY when not blank

(0) ShareShare
ReportReport
Posted on by 4

Hi Folks

I am trying to update numerous records based on a single drop-down value. However, if the drop-down value is blank I do NOT want the selected records to change. I am using the following code which works but updates all selections including blank.

"Devices_collection" is the collection of ALL my records

"ColSelected" is a few records selected from Devices_collection

 

//CODE

UpdateIf(
Devices_collection,
ThisRecord in ColSelected,
{
'deployment-status': DeploymentStatusUpdate.Selected,
'device-status': DeviceStatusUpdate.Selected,
'device-location': DeviceLocationUpdate.Selected,
'model-lookup': ModelUpdate.Selected
}
);

//END code

thanks in anticipation

paul walker (not fast or furious)

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,110 Most Valuable Professional on at

    Hi @paulieHETI ,

    I am a little unclear here - you are updating one collection from another, but the drop-downs (you seem to have 4 of them) are controls on the screen, so are unrelated to either collection, so what is it you are wanting to happen when (whichever) drop-down is blank ?

  • paulieHETI Profile Picture
    4 on at

    Hi Warren

    Thanks for your response.

    I first select a few records that I wish to edit.

    There are 4 drop-down options in each of these records.

    I have a four drop-downs controls containing the same options as each selected record which update the selected records on save.

    However, If one of the controls is left blank I do not want the blank value sent to each record - I want those drop-downs to remain as they were.

    So, in my head, the code would look like this:

    UpdateIf(
    Devices_collection,
    ThisRecord in ColSelected,
    If(
    !IsBlank(DeploymentStatusUpdate),
    {'deployment-status': DeploymentStatusUpdate.Selected}
    ),
    If(
    !IsBlank(DeviceStatusUpdate),
    {'device-status': DeviceStatusUpdate.Selected}
    )
    );

    Hope this makes sense 

    Thanks again

    p

  • paulieHETI Profile Picture
    4 on at

    Graphical representation

    the-form.jpg

  • WarrenBelz Profile Picture
    156,110 Most Valuable Professional on at

    @paulieHETI ,

    The drop-downs are not part of the collection - they are part of the galley - you need to refer to whatever field names in colSelected get populated from those drop-downs.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard