Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

patching to sp list from gallery input controls

Posted on by 19
i have a form along with multiple galleries that are not connected to a data source but contain input controls (see image below). the number of inputs in the gallery is controlled by the number dropdown at the top of the screen.
 
the information at the top of the screen is standard for all records i am looking to patch and the information gathered from the galleries will be different at each patch. 
 
when i try using the following code to patch, the results from the galleries does not change even though i am selecting a different item in the gallery each time. in other words, the patched results only are 3 records all with the same information.
 
  • ess1 Profile Picture
    ess1 19 on at
    patching to sp list from gallery input controls
    How can i make all the fields in both the gallery and form required?
     
    working on the display mode of the submit button ive tried the following:
     
    If(!DailyCrewForm.Valid || (IsBlank(CrewLeadCombobox.Selected.DisplayName) || IsBlank(FTENumberInput.Value) || IsBlank(CrewCodeInput.Value) || IsBlank(PhoneInput.Value) || IsBlank(StartTimeInput.Value) || IsBlank(EndTimeInput.Value)), DisplayMode.Disabled, DisplayMode.Edit)
     
    this worked but it only applied to the first row of the gallery so if the user is trying to input 2 or more, only the first needs to be filled out for the submit button to be clickable
     
    i then tried testing this out but received the error "expected enum value"
    ForAll(CrewInfoInputGallery.AllItems,
        If(IsBlank(ThisRecord.CrewCodeInput.Value),
            DisplayMode.Disabled,
            DisplayMode.Edit))
  • Suggested answer
    FLMike Profile Picture
    FLMike 29,366 on at
    patching to sp list from gallery input controls
    Hi
     
    If you can please mark my answer as the answer I would appreciate it.
     
  • ess1 Profile Picture
    ess1 19 on at
    patching to sp list from gallery input controls
    I moved them all to one gallery. thank you @FLMike!! 
  • Verified answer
    ess1 Profile Picture
    ess1 19 on at
    patching to sp list from gallery input controls
    that was super helpful! yes half the record comes from the top half of the screen and the other half from the galleries on the bottom half
     
    it works when i am patching only one gallery. is there anyway to patch all the galleries at once? for reference there are 7 different vertical galleries. 
     
     
  • Suggested answer
    FLMike Profile Picture
    FLMike 29,366 on at
    patching to sp list from gallery input controls
    Hi,
     
    Hopefully I am following but you are putting 3 record in (based on your example) and half the data comes from the gallery and is different and half comes from the top.
     
    Then do this.
     
    ForAll(Gallery.AllItems,
    
       Patch(TheSource, Defaults(TheSource),
       {
          MyFieldFromTop: TopField.Text/ValueWhatever,
          MyFieldFromGallery: ThisRecord.MyGalleryControl.Value/Text etc
       }
    );
    
    And done
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard