cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

drop down list control selected values used in corresponding datacard for SharePoint list

In a PowerApps app, there is a screen for the user to enter data, both text and via dropdowns.  These controls are not datacards in a form (For a SharePoint list) but do correspond to them.

On another screen, not visited by any app user, is a form to submit new items (no edit needed).  For all of the text fields, it's very easy just to change the default value of the datacard to be the text field control.  Not so much for the dropdowns.  For example, if the app has a dropdown control, DRPCHOICE, on the corresponding datacard for the SP list which is a choice field, specifiying the value DRPCHOICE.SELECTED has no effect, nor does changing the UPDATE parameter. 

My question is, how can the control be coupled to the choice datacard, if at all?

  1. in the dropdown control, I specifya list of item ["a","b","c"] for example.  Should I change this to point to the acutal SP list choices, and if so, how would I do that?  @ODATA? but what are the values I would use?
  2. submit the form as new, then follow it up with a Patch() command to update the drop down values?  How do I grab the ID of the record created with the SubmitForm() just executed?
  3. Or something else entirely different?

Thanks - always great when someone provides advice and guidance.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: drop down list control selected values used in corresponding datacard for SharePoint list

problem solved.

 

On the entire data card, not the value portion, I set default to be drpcontrol.selected, and that grabs the selected value for the drop down control located elsewhere.  On that drop down control, I set items to choices(splist.choicecol) and that works by getting choices from the SP list choice column.

View solution in original post

4 REPLIES 4
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: drop down list control selected values used in corresponding datacard for SharePoint list

@lmheimendinger ,

 

Let me know if I got this right:

  • You are able to set the Default property of a label to text easily
  • You are setting a drop down control's Default property to DRPCHOICE.SELECTED.

 

Can you check if you intended to use a combo box and not a drop down menu?

 

A dropdown menu takes a single field as a Default. Ex. If the field shown in the drop down menu is a number, then the default should be a numerical value. If it's text, the default would expect a text string.

 

But a combo box on the other hand has a Default that is a record type. Think of it as one row full of data. 

 

Can you check which control you were expecting? If It's a drop down, you can drill into DRPCHOICE more:

DRPCHOICE.SELECTED.desired_column_name_here

Let me know if this was it.

Community Support Team
Community Support Team

Re: drop down list control selected values used in corresponding datacard for SharePoint list

Hi @lmheimendinger ,

For your first question, if you want to bind your Dropdown control with the Choice field in your SP list, please consider take a try to set the Items property of the Dropdown box to following:

Choice('YourSPList'.ChoiceField)

Actually, it is not necessary to change Dropdown box to point to the acutal SP list choices, you could specify any table values within your Dropdown box. Then when you submit your Dropdown box selected value to your SP list, please take a try with the following Patch formula:

Patch(
          'YourSPList',
           Defaults('YourSPList'),
           {
             ChoiceFiled: {
                              Value: Dropdown1.Selected.Value
                          }
           }
)

 

 

For your second question, if you want to grab the ID value of the latest submitted form, I think the LastSubmit property of the Edit form could achieve your needs. Please consider take a try to add the following Patch formula within the OnSuccess property of the Edit form:

Patch(          /* <-- Update Choice filed in your SP list */
          'YourSPList',
           LookUp('YourSPList', ID = EditForm1.LastSubmit.ID),  /* <-- EditForm1 represents the Edit form control in your app */
           {
             ChoiceFiled: {
                             Value: Dropdown1.Selected.Value
                          }
           }
)

Please take a try with above solution, check if the issue is solved.

 

Best regards,

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

Re: drop down list control selected values used in corresponding datacard for SharePoint list

problem solved.

 

On the entire data card, not the value portion, I set default to be drpcontrol.selected, and that grabs the selected value for the drop down control located elsewhere.  On that drop down control, I set items to choices(splist.choicecol) and that works by getting choices from the SP list choice column.

View solution in original post

Re: drop down list control selected values used in corresponding datacard for SharePoint list

sorry this posted as a duplicate response

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 439 members 6,164 guests
Please welcome our newest community members: