cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UB400
Kudo Kingpin
Kudo Kingpin

Forms choose alternative source for DropDown control

I have a Sharepoint List, with most of the Columns being Lookup Columns from other Sharepoint Lists. While this works great, as in the Form working correctly as one would expect with the DropDowns populated correctly, the performance leaves a lot to be desired i.e. everytime clicking on a DropDown, it takes a few seconds to populate the DropDown list.

 

While I can create Collections locally on the device from the SP lists, is there a way to point the DropDown to the locally stored Collection instead of retrieving it from Sharepoint?

 

Main reason I chose to use Forms was to get the LastSubmit.ID for the new record created when the Form is submitted. As an alternative is there a way to get the ID of the newly Created ID when using something like "Patch" instead of Forms?

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

@UB400, Patch returns back the item created and the only way to access it is to collect it at the moment of the patch.

 

So the formula would be something like this:

Collect(createdItem, Patch(Destination, Defaults(Destination), {
       column1: value1,
       column2: value2
    }))

After that your 'createdItem' collection should contain the entire object created and you should be able to access what info you need from there.

View solution in original post

4 REPLIES 4
v-micsh-msft
Community Support
Community Support

Hi @UB400,

 

If the dropodwn controls are working with SharePoint Lookup field, then take use of collection may not so easy to make it work.

I think you should already noticed that Lookup field are record type, see the following thread for how to deal with Lookup fields using patch:

How to patch SharePoint List Lookup field, such as people, choice, or the custom Lookup column type 

 

The example of the Lookup field in PowerApps is as below:

{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
   Id           :8,
   Value        :"235"
   }

Further, to get the newly created ID field, I think it is better to use the Form.LastSubmit property, as other methods would need to start a new query to get the updated record.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-micsh-msft thanks for the response, I'm familiar with using Patch with lookup records, I was just hoping that there was a way to retrieve the ID of the newly created Record in a similar fashion as LastSubmit for Forms.

 

Is there a way to point the DropDown column in a Form to another Source rather than the original list that the Form is associated with? Basically I'm trying to improve the performance, currently clicking on the drop down takes time to load the options in the Dropdown.

Anonymous
Not applicable

@UB400, Patch returns back the item created and the only way to access it is to collect it at the moment of the patch.

 

So the formula would be something like this:

Collect(createdItem, Patch(Destination, Defaults(Destination), {
       column1: value1,
       column2: value2
    }))

After that your 'createdItem' collection should contain the entire object created and you should be able to access what info you need from there.

@AnonymousYou're a GENIUS! That is awesome, thank you so much. In one fell swoop, you've eliminated one of my biggest headaches!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,357)