cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
daniellemaree
Level: Powered On

Default Dropdown

Hi 


I have 2 drop downs

 

  • Request (Yes/No) Dropdown from SP list 
  • COP Request (Lookup) Dropdown SP List

These need to have set defaulted values. I have looked at the other forums on this topic and my expression doesnt appear to picking up the value. See screen shot.

 

 

So for request I have used:

If(EditForm1.Mode=FormMode.New,{'@odata.type': #Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id: 0, Value:"Yes"},ThisItem.Same_x0020_User_x0020_Request)

 

As for the 2nd COP list could you please help how the expression should be written as this is a lookup?

 

Thanks

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Default Dropdown

Hi @daniellemaree,

Do you want to set a default value for a Lookup column within the Edit form (which is connected to a SP list) in your app?

 

If you want to set a default value for a Lookup column within the Edit form (which is connected to a SP list) in your app, please check my response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-field-to-display-user/m-p/159573#M5378...

You could also check the following thread for more details:

https://powerusers.microsoft.com/t5/Creating-Apps/Sharepoint-list-lookup-and-default-value-in-a-form...

 

On your side, please take a try to type the following formula within the DefaultSelectedItems property of the second Combo box control (COP Group) to following formula:

If(
  EditForm1.Mode=FormMode.New,
  {
   '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:LookUp('YourLookUpList',GroupName="Data Science",ID),
    Value:"Data Science"  /* <-- default value, which has been existed within the YourLookUpList */
  },
ThisItem.Select_x0020_a_x0020_COP_x0020_Group )

Note: The 'YourLookUpList' represents your Lookup column references values from. The GroupName represents the column in the 'YourLookUpList', which your Lookup column references values from. The Select a COP Group represents the Lookup column.

 

Please also check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

Best regards,

Kris

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.
6 REPLIES 6
Microsoft Employee

Re: Default Dropdown

Hello @daniellemaree

Can you confirm that you're actually using DropDown controls (sorry, I could not tell from screenshots)? If so, any reason for not using ComboBox controls instead?

Since you're using SharePoint, is there any reason you're not configuring the default values on the SharePoint list?

daniellemaree
Level: Powered On

Re: Default Dropdown

Hi @dinusc It was the preferance to use a drop down rather then a combo box .

 

I am not sure if this would make a difference for how the information be defaulted differently?

 

For the first drop down i have already set the default value to "Yes" however it doesnt appear to bring that value through. 

 

The second is a list lookup so I wasnt able to set a default to this. As i would hope it would be possible in powerapps function.

 

I have added more screen shots

 

Thanks

 

Danielle

Capture55.PNG

 

 

 

 

Microsoft Employee

Re: Default Dropdown

Please try the following:

1. Make sure the default values are configured on the SharePoint list

2. Create an EditForm and bind it to the SharePoint list.

3. By default, you should get ComboBox controls bound to selection type fields.

 

I believe the default parameters should work properly in ComboBox controls. You should not need any special formulas for that.

To answer your question, ComboBox control is much more advanced than the DropDown control In this case, I woudl suggest using ComboBox control since it can parse SharePoint metadata automatically. 

 

daniellemaree
Level: Powered On

Re: Default Dropdown

Hi @dinusc

 

I have changed my dropdowns to the combo boxes as you have suggested. The default values in sharepoint list are still not appearing as these settings were used previously.

 

How do i bring back the default values in the combo box? As these are not displaying the values

 

Please see screen shot.

Capture66.PNGCapture68.PNG

Microsoft Employee

Re: Default Dropdown

I can confirm that this is indeed a problem. I will report this issue internally.

Meanwhile, the formula you tried as a workaround is almost correct. Please see if the updated version below works for you. Please also note that it needs to be assigned to the YourComboBox.DefaultSelectedItems property:

If(EditForm1.Mode=FormMode.New, Table({'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id: 0, Value:"Yes"}),[ThisItem.Same_x0020_User_x0020_Request])

 

Community Support Team
Community Support Team

Re: Default Dropdown

Hi @daniellemaree,

Do you want to set a default value for a Lookup column within the Edit form (which is connected to a SP list) in your app?

 

If you want to set a default value for a Lookup column within the Edit form (which is connected to a SP list) in your app, please check my response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-field-to-display-user/m-p/159573#M5378...

You could also check the following thread for more details:

https://powerusers.microsoft.com/t5/Creating-Apps/Sharepoint-list-lookup-and-default-value-in-a-form...

 

On your side, please take a try to type the following formula within the DefaultSelectedItems property of the second Combo box control (COP Group) to following formula:

If(
  EditForm1.Mode=FormMode.New,
  {
   '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:LookUp('YourLookUpList',GroupName="Data Science",ID),
    Value:"Data Science"  /* <-- default value, which has been existed within the YourLookUpList */
  },
ThisItem.Select_x0020_a_x0020_COP_x0020_Group )

Note: The 'YourLookUpList' represents your Lookup column references values from. The GroupName represents the column in the 'YourLookUpList', which your Lookup column references values from. The Select a COP Group represents the Lookup column.

 

Please also check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

Best regards,

Kris

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.