0

1)when nothing got checked in the gallery items but then I click final update button then items are getting patched randomly .

  1. Need help on how to patch multiple selected items for the below gallery items

New update is :This is working fine but unless user enter input then it should not patch

Recent code Set(varrecord,Gallery2.Selected); ForAll( Filter( Gallery2.AllItems, Checkbox1.Value ), Patch( Roster, Defaults(Roster), {

       Title:varrecord.Title,                   
       VacancyID: Value(TextInput1.Text),
       Division :varrecord.Division,
       Department:varrecord.Department,
       SRStatus:varrecord.SRStatus
      
                            
  
}

); ); UpdateContext({locResetCheckbox:true}); Reset(TextInput1); UpdateContext({locResetCheckbox:false});

1 Answer 1

1

Your FinalUpdate button's OnSelect formula should be something more like this:

//For all items in your gallery that are checked
ForAll(
    Filter(
        Gallery_ShortSRdet.AllItems,
        Checkbox1.Value //Update with the name of your checkbox control
    ),
// Patch the Role field of your data source with the value of your dropdown control
    Patch(
        ShortlistedRoster,
        ThisRecord,
        {Role: Dropdown5.Selected.Value}
    )
);

UPDATE

To reset the checkboxes, add this to the end of the formula above:

UpdateContext({locResetCheckbox:true});
UpdateContext({locResetCheckbox:false})

you will then need to change the Reset property of your checkbox to locResetCheckbox

5
  • Thanks,how to clear the checkbox after selection.please help
    – Bzl
    Dec 20, 2022 at 19:44
  • 1
    I've updated my answer with instructions on how to reset the checkbox
    – user79408
    Dec 20, 2022 at 21:35
  • Thanks a lot.Great help and it worked
    – Bzl
    Dec 22, 2022 at 15:52
  • Can you please help me with one more level of issues as when i click copy button then it should not patch unless my text box value is inputted and how to check that condition in my patching code
    – Bzl
    Dec 23, 2022 at 14:30
  • Please refer above code and it works fine when click copy button byt issue is textbox is required so how to check if textbox is not empty then patch
    – Bzl
    Dec 24, 2022 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.