0

I have a Power Apps form (customized SharePoint form), where I have a requirement to display a multi-select dropdown (Region) as checkboxes. The data submits correctly, and when a submitted item is reopened, the checkboxes still retain their values. BUT, if a submitted item is edited (re-submitted), the column value disappears, and the checkboxes clear out. Here's how I have it set up:

  • Multi-select Choice field (Region). Added 5 checkboxes to the data card.

  • Checkbox properties:

    OnCheck & Uncheck: 
                  ClearCollect(
                  Region5,
                  If(Checkbox2.Value, "UO"),
                  If(Checkbox2_1.Value, "USH"),
                  If(Checkbox2_2.Value, "USJ"),
                  If(Checkbox2_3.Value, "USS"),
                  If(Checkbox2_4.Value, "Other"));
             ClearCollect(Region5,Filter(Region5, !IsBlank(Value)))
    
     Default: Self.Text in Concat(ThisItem.Region, Value&",")
    
  • DatacardValue Properties: Defaultselecteditems: Region5

  • Datacard Properties: Default: Thisitem.Region Update: Region5

Region 5 is the name of my collection for the "Region" Choice (checkbox) field.

Again, this set of properties successfully logs the selected checkbox(es) into the SharePoint list. But when a user opens an existing item, modifies it, then clicks the 'Submit' button again (OnSelect - SubmitForm(SharePointForm1), that value clear out in SharePoint and the form.

Any help would be great. This is driving me crazy.

Thanks!

5
  • You will have to populate the Region5 collection when opening list form in edit mode. Example: try setting SharePointIntegration.OnEdit to ClearCollect(Region5, ThisItem.Region). Let me know if it works for you. Mar 21 at 14:06
  • I just added that code you suggested to OnEdit property for SharePointIntegration and got an error: "The function ClearCollect has some invalid arguments". And "Name isn't valid. 'ThisItem' isn't recognized.
    – Chris
    Mar 21 at 14:12
  • 1
    Try: ClearCollect(Region5, SharePointIntegration.Selected.Region);. Mar 21 at 14:14
  • That did it. THANK YOU. I ended up using this in my OnEdit -EditForm(SharePointForm1); ClearCollect(Region5, SharePointIntegration.Selected.Region). Works perfectly
    – Chris
    Mar 21 at 14:32
  • Yes, EditForm(SharePointForm1); is already there by default. Glad it worked for you. I have added same as an answer below. Mar 21 at 14:53

1 Answer 1

1

I think you will have to populate the Region5 collection again when opening the SharePoint list form in edit mode.

Try using below formula in SharePointIntegration.OnEdit property:

EditForm(SharePointForm1);
ClearCollect(Region5, SharePointIntegration.Selected.Region);

Where SharePointForm1 is the name of form control and Region is the name of your choice column in the list.

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.