Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

patch different data from a single dynamic dropdown to multiple columns

(1) ShareShare
ReportReport
Posted on by 123
I have a gallery with a dynamic dropdown list itemState in each record, which returns different choices based on the respective column in the linked SharePoint List.
 
I then want to patch the choices from each row to the corresponding record & column in SharePoint, however because it is a single dropdown list shared for every column, the most recent value of itemState gets patched onto all of them. For example, I have 3 columns "Projector 1" "Projector 2" "Projector 3." Each one has choices "Working, Broken, N/A, Missing". If I select "Working" for Projector 3 and hit patch, it patches it to all three. Is there a way I can avoid this, maybe using a Switch or ForAll Loop? Here's what I have now:
Patch('25/26 Summer Room Checks', LookUp('25/26 Summer Room Checks', Title = selectedRoom.Title),
    {
        'Projector 1': itemState.SelectedText,
        'Projector 2': itemState.SelectedText,
        'Projector 3': itemState.SelectedText,
        'Lectern Motor': itemState.SelectedText,
        'Television': itemState.SelectedText,
        'Speakers': itemState.SelectedText,
        'PC': itemState.SelectedText
})
 
  • WarrenBelz Profile Picture
    WarrenBelz 145,434 on at
    patch different data from a single dynamic dropdown to multiple columns
    It seems you are saying that the gallery contains those seven items for the one room (one on each record) and there is a drop-down in each row to record the condition of the item. What is the Items of the gallery and maybe supply a screenshot ? I also assume that all of those columns are Choice columns.
  • SaiRT14 Profile Picture
    SaiRT14 1,926 on at
    patch different data from a single dynamic dropdown to multiple columns
    Hi  
     
    Loop through the gallery items and patch the corresponding values for each record in the SharePoint list using a ForAll loop
    ForAll(
        GalleryName.AllItems,
        Patch(
            '25/26 Summer Room Checks',
            LookUp('25/26 Summer Room Checks', Title = ThisRecord.Title),
            {
                'Projector 1': ThisRecord.Projector1Dropdown.SelectedText,
                'Projector 2': ThisRecord.Projector2Dropdown.SelectedText,
                'Projector 3': ThisRecord.Projector3Dropdown.SelectedText,
                'Lectern Motor': ThisRecord.LecternMotorDropdown.SelectedText,
                'Television': ThisRecord.TelevisionDropdown.SelectedText,
                'Speakers': ThisRecord.SpeakersDropdown.SelectedText,
                'PC': ThisRecord.PCDropdown.SelectedText
            }
        )
    )
     
    pls try and let me know if you need more details.
     
    thanks.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard