cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chaitanyaChavan
Frequent Visitor

Validate combobox for default selected items is not blank

I am trying to validate the combobox default selected items,

When they select the items in the new form, they are concatenated and stored in the form of string in SQL column,

and when they try to edit that, it is split from a label as default selected items and it displays the default list.

 

When in the edit form, I am not able to validate the comboxbox though. Since it just validates for selected items and not default selected items.

 

Can anyone help me out on how to check if the combobox is null for default selected items?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @chaitanyaChavan,

Do you want to check if the Default selected items of the Combo box control is blank?

How do you set the DefaultSelectedItems property within the Combo box control?

 

If you want to check if the Default selected items of the Combo box control is blank, I have made a test, please take a try with the following workaround:8.JPG

 

9.JPG

Set the DefaultSelectedItems property of the Combo box control to following formula:

If(
   EditForm1.Mode=FormMode.New,
  {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Value:"Default Value"         /* <-- Set default value */
  },
  Parent.Default
)

Set the Text property of the Label control to following formula:

DataCardValue5.Selected.Value

Note: The DataCardValue5 represents the Combo box control within my Edit form.

If you have set the DefaultSelectedItems property of the Combo box control as I mentioned above, then when you open a new form, you could use the following formula to check if the Default selected items is blank:

If(IsBlank(DataCardValue5.Selected.Value),"Blank","Not Blank")

The GIF screenshot as below:Test1.gif

 

More details about set a Default value for a Choice type column of SP list within Edit form, please check the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Set-default-value-for-a-drop-down-in-a-new-fo...

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.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @chaitanyaChavan,

Do you want to check if the Default selected items of the Combo box control is blank?

How do you set the DefaultSelectedItems property within the Combo box control?

 

If you want to check if the Default selected items of the Combo box control is blank, I have made a test, please take a try with the following workaround:8.JPG

 

9.JPG

Set the DefaultSelectedItems property of the Combo box control to following formula:

If(
   EditForm1.Mode=FormMode.New,
  {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Value:"Default Value"         /* <-- Set default value */
  },
  Parent.Default
)

Set the Text property of the Label control to following formula:

DataCardValue5.Selected.Value

Note: The DataCardValue5 represents the Combo box control within my Edit form.

If you have set the DefaultSelectedItems property of the Combo box control as I mentioned above, then when you open a new form, you could use the following formula to check if the Default selected items is blank:

If(IsBlank(DataCardValue5.Selected.Value),"Blank","Not Blank")

The GIF screenshot as below:Test1.gif

 

More details about set a Default value for a Choice type column of SP list within Edit form, please check the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Set-default-value-for-a-drop-down-in-a-new-fo...

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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,964)