Set collection to selected values in Power Apps form when opened in edit mode

Viewed 754

I have a SharePoint list-integrated Power Apps form. I have a multi-select combobox called DataCardValue4 (which is hidden) that comes from a choice on the SharePoint list.

I need to put the selected values of this combobox into a collection when the form is edited.

On SharePointIntegration, on Edit, I have:

ForAll(DataCardValue4.SelectedItems, Collect(colVehiclesRequested,ThisRecord.Value));

This works fine when the user opens the form and puts it in edit mode manually. Unfortunately, I have a Power Automate flow which gives a link that opens the form in edit mode directly.

When the form is opened in edit mode, DataCardValue4.SelectedItems is empty at the time of SharePointIntegration on edit.

Is there another way to do this? Is there another place to put this further down the lifecycle so it will work properly?

I guess I'm kind of looking for the document.ready version of a Power Apps-integrated form.

2 Answers

I'd try to put your formula into the Screen.OnVisible property with some conditional wrapping. This would make sure it (also) runs when it is opened directly.

I had the same issue, I added the code in the App.OnStart

Related