Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Patch problem with gallery

(0) ShareShare
ReportReport
Posted on by 134

i am 100% sure i am overthinking this, but for some reason i cannot seem to patch this. 

I have a collection (CLLocal) that is a filter from a very large list ('Contraband Log (CL)'). In the app I have a variable pulling the CLLocal (I could also pull it from AdminCLGal.Selected if that makes any difference) entry from a view page to an edit page. There are a LOT of columns that need to be able to be updated. 

 

The edit page gallery (CLAdminEditGal) only displays the one row on the list because of the size. How can I send the updates they make on the gallery to the list? Do I need to send it to the collection and then the list?  Honestly I've spent about 8 hours on this one page and cant make this one thing work for the life of me.

 

Below are my SPList columns and their accompanying input fields

 

{
CLDateOfContrabandDiscovery: CLDate.SelectedDate,
CLOffenderNumber: Value(CLNumber.Text),
CLOffenderLastName: CLName.Text,
CLOffenderSecurityLevel: Securitylevel.Selected.Value,
CLWhatWasTheTimeOfTheContrabandD: CLTime.Selected.Value,
CLWhatDayOfTheWeekWasTheContraba: DayofWeek.Selected.Value,
CLWhereInThePhysicalPlanWasTheC: CLPPLoc.Selected.Value,
CLIfContrabandWasDiscoveredInThe: Mailroom.Text,
CLIfContrabandWasDiscoveredInAHo: HousingUnit.Text,
CLTypeOfContraband: CLType.SelectedItems,
CLWeaponType: CLWeaponType.Selected.Value,
CLWeaponMaterial:CLWeaponMaterial.Selected.Value,
CLNarcoticType:CLNarcType.Selected.Value,
CLQuantityOfNarcoticsDiscovered: CLNarcNum.Text,
CLStreetValueOfContraband: CLNarcValue.Text,
CLDidAnAssultTakePlace: CLAssault.Selected.Value,
CLSummaryOfIncident: CLSummary.Text,
CLWasSmugglingAttemptedDuringThi: CLSmuggle.Selected.Value,
CLRaceOfOffender: CLRace.Selected.Value,
CLAgeGroup: CLAge.Selected.Value,
CLOffenderCrime: CLOffense.Selected.Value,
CLWhatIsTheERDofTheOffender: CLERD.Selected.Value,
CLDoesOffenderHavePassedDrugCrim: CLDrugCrime.Selected.Value,
CLContrabandLocation: CLSpecLoc.Selected.Value,
CLWasAPoliceReportFiled: LEAToggle.Value,
CLWasACIRGenerated: CIRToggle.Value,
CIRNumber: CLCIRNum.Text,
MSPComplaintNumber: CLLEANum.Text,
Wasthecontrabandfoundwithascanne: CLScanner.Value,
Whichscanner_x003f: CLScannerused.Selected.Value
}

Pg 1

BHaapi_0-1697140990806.png

Pg 2

BHaapi_1-1697141011413.png

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Patch problem with gallery

    Hi @BHaapi ,

    I have to make some assumptions here as your model is not totally clear to me, but assuming this is a SharePoint List and you are selecting the record from AdminCLGal and then setting your Variable

    Set(CLLocal, AdminCLGal.Selected)

    which if you put OnSelect of the Gallery, you can do this

    Set(CLLocal, ThisItem)

    and the controls on the screen are based on the Record Variable CLLocal, then you would Patch them back to the selected record like this. Note I have not looked at the validity of the values you are patching.

    Patch(
     ('Contraband Log (CL)',
     {ID: CLLocal.ID},
     {
     CLDateOfContrabandDiscovery: CLDate.SelectedDate,
     CLOffenderNumber: Value(CLNumber.Text),
     CLOffenderLastName: CLName.Text,
     CLOffenderSecurityLevel: Securitylevel.Selected.Value,
     CLWhatWasTheTimeOfTheContrabandD: CLTime.Selected.Value,
     CLWhatDayOfTheWeekWasTheContraba: DayofWeek.Selected.Value,
     CLWhereInThePhysicalPlanWasTheC: CLPPLoc.Selected.Value,
     CLIfContrabandWasDiscoveredInThe: Mailroom.Text,
     CLIfContrabandWasDiscoveredInAHo: HousingUnit.Text,
     CLTypeOfContraband: CLType.SelectedItems,
     CLWeaponType: CLWeaponType.Selected.Value,
     CLWeaponMaterial:CLWeaponMaterial.Selected.Value,
     CLNarcoticType:CLNarcType.Selected.Value,
     CLQuantityOfNarcoticsDiscovered: CLNarcNum.Text,
     CLStreetValueOfContraband: CLNarcValue.Text,
     CLDidAnAssultTakePlace: CLAssault.Selected.Value,
     CLSummaryOfIncident: CLSummary.Text,
     CLWasSmugglingAttemptedDuringThi: CLSmuggle.Selected.Value,
     CLRaceOfOffender: CLRace.Selected.Value,
     CLAgeGroup: CLAge.Selected.Value,
     CLOffenderCrime: CLOffense.Selected.Value,
     CLWhatIsTheERDofTheOffender: CLERD.Selected.Value,
     CLDoesOffenderHavePassedDrugCrim: CLDrugCrime.Selected.Value,
     CLContrabandLocation: CLSpecLoc.Selected.Value,
     CLWasAPoliceReportFiled: LEAToggle.Value,
     CLWasACIRGenerated: CIRToggle.Value,
     CIRNumber: CLCIRNum.Text,
     MSPComplaintNumber: CLLEANum.Text,
     Wasthecontrabandfoundwithascanne: CLScanner.Value,
     Whichscanner_x003f: CLScannerused.Selected.Value
     }
    }

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard