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 Gallery Items b...
Power Apps
Answered

Update Gallery Items based on drop down list control selected value

(0) ShareShare
ReportReport
Posted on by 183

Hi Team,

 

I have gallery which is tied to a SharePoint list. It has a drop down list control in each row. If drop down list status is set to "Yes", two fields have to updated in SharePoint list and if drop down list status is set to "No"/"No-Not Available"/"No-Not Applicable", four fields have to updated in SharePoint list.

 

I tried the following expression. The second expression does not get executed at all. Could someone guide me on this please?

 

ForAll(Filter(gallery.AllItems, "No" in ddlStatus.Selected.Value),
UpdateIf(
'DataSource', ID = Value(lblItemID.Text),
{'Column1': "Text"}
)
);ForAll(Filter(gallery.AllItems, ddlStatus.Selected.Value = "Yes"),
UpdateIf(
'DataSource', ID = Value(ItemID.Text),
{'Column1': "Text"', 'Column2': 'Column3': "Text",'Column4': "Text"}
)
)

 

Thanks,

SV

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

    Hi @sunithav 

    Please provide a screenshot of your gallery.  I cannot tell from your description what you are trying to do.  

  • CU20081036-0 Profile Picture
    183 on at

    Hi @Drrickryp ,

     

    Thanks for checking this post. Here is the screenshot of the gallery which is connected to a SP list. There is a drop down list in the gallery with items ["Yes","No","No-Not Applicable","No-Not Available"]. If drop down list status is set to "Yes", save first field value in SharePoint list and if drop down list status is set to "No"/"No-Not Available"/"No-Not Applicable", save both field values in SharePoint list on Save button click.  

     

    sunithav_0-1610341233736.png

    Thanks,

    SV

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @sunithav :

    I've made a test but it worked well on my side:

    1\My data source:

    1.JPG

    2\Add a gallery(gallery) and set it's items property to:

    DataSource

    3\Add a label control(lblItemID) into this gallery and set it's text property to

    ThisItem.ID

    4\Add a combobox(ddlStatus) into this gallery and set it's items property to

    ["Yes","No","No-Not Applicable","No-Not Available"]

    5\Add a button control and set it's OnSelect proeprty to(I noticed that the formula you provided may have some errors, I have marked them in red):

     

    ForAll(Filter(gallery.AllItems, "No" in ddlStatus.Selected.Value),
    UpdateIf(
    'DataSource', ID = Value(lblItemID.Text),
    {'Column1': "Text"}
    )
    );ForAll(Filter(gallery.AllItems, ddlStatus.Selected.Value = "Yes"),
    UpdateIf(
    'DataSource', ID = Value(lblItemID.Text),
    {'Column1': "Text", 'Column2': "Text",'Column3': "Text",'Column4': "Text"}
    )
    )

    36.gif

    In addition,you can also try this formula to submit:

    ForAll(
     gallery.AllItems,
     If(
     "No" in ddlStatus.Selected.Value,
     UpdateIf('DataSource', ID = Value(lblItemID.Text),{'Column1': "Text"}),
     "Yes" in ddlStatus.Selected.Value,
     Patch('DataSource', LookUp('DataSource',ID = Value(lblItemID.Text)),{Column1: "Text", Column2: "Text",Column3: "Text",Column4: "Text"})
     )
    )

    Or

    ForAll(Filter(gallery.AllItems, "No" in ddlStatus.Selected.Value),
    UpdateIf(
    'DataSource', ID = Value(lblItemID.Text),
    {'Column1': "Text"}
    )
    );ForAll(Filter(gallery.AllItems, ddlStatus.Selected.Value = "Yes"),
    Patch(
    'DataSource', LookUp('DataSource',ID = Value(lblItemID.Text)),
    {Column1: "Text", Column2: "Text",Column3: "Text",Column4: "Text"}
    )
    )

    These formulas also worked well on my side

    Best Regards,

    Bof

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard