cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simms7400
Level 8

ComboBox Default Property - formula not working

Hi Folks -

I have a ComboBox (a choice field from a SP List) and I'm trying to add a formula to it to automaticaly populate based on a selection of another field.  This formula works perfectly on a Default propery for a  Label or input text field:

LookUp(RD_Target_List, Name=Concatenate("PFR-",DataCardValue25.Text), Target_Long_Name)

But when I add it too the ComboBox Defauly property, it fails saying it needs a text value? Can someone assist?

 

Thank you!

2 ACCEPTED SOLUTIONS

Accepted Solutions
simms7400
Level 8

Re: ComboBox Default Property - formula not working

@RandyHayes 

 

Hi Randy!

 

Allow me to clarify. The field I'm trying to populate is maybe not a ComboBox, although I have been calling it such. It's a choice SharePoint List field. It's called "Business_Owner" (display name is R&D Unit) and located in SP List called "rdAsset".

RANDYY.jpg

 

This field should be populated based on the selection of the "Target Alias" field:

target alias.jpg

 

Target Alias is populated with a list of values from the table "RD_Target_List" and "Alias" column.  And is this what "RD_Target_List" like:

lookup.jpg

So based on the selection of "Target Alias", I need to return the value in the "Business_Owner" column from "RD_Target_List".

 

The values in the "Business_Owner" field on my form are the same list of values in the "Business_Owner" column of "RD_Target_List".

 

I hope this makes sense, if not let me know.

 

Thank you, Randy!

 

View solution in original post

Super User
Super User

Re: ComboBox Default Property - formula not working

@simms7400 

So let me repeat to make sure I understand - you have a column in your SharePoint list called "Business_Owner" that is a choice column and has all the same values (as the choices) as the table RD_Target_List's Business Owner field.

You have another column in your SharePoint list called "Target Alias" - I presume that it has all the same values as the Alias field in your RD_Target_List.

You need R&D Unit (Business_Owner) to default to the value of the "Business Owner" as determined by a lookup from the RD_Target_List based on the "Target Alias" value selected.

 

I hope the above is correct...

 

Now - Your ComboBox (DataCardValue51) should be set to the following:

   Items : Choices(rdAsset.Business_Owner)

   DefaultSelectedItems :  {Value: Lookup(RD_Target_List, Alias=yourTargetAliasControlName.Selected.Value, Business_Owner)}

I didn't see the name of the combobox control for your Target Alias, so just substitute that in the blue above.

 

I hope that nails it for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

13 REPLIES 13
emh
Level 8

Re: ComboBox Default Property - formula not working

Hello,

 

ComboBoxes can  be tricky. I leave the Default property blank. However, I use the DefaultSelectedItems property and the combo box works as expected. Give it a try and let me know how it works out.

simms7400
Level 8

Re: ComboBox Default Property - formula not working

@emh  HI there.

 

So I did try to add the formula to thee DefaultSelectedItems and it works but only if I dont specify the "Business_Owner":

LookUp(RD_Target_List, Name=Concatenate("PFR-",DataCardValue25.Text))

But it doesn't solve my issue as the reason for the lookup is I need to derive the "Name" based on a value entered my form then return the value from the "Business_Owner" column of RD_Target_List.  I really need it like this, but its giving me an error ("expected table value"):

 

LookUp(RD_Target_List, Name=Concatenate("PFR-",DataCardValue25.Text), Business_Owner)

To confirm, the values in the "Business_Owner" column are also in the available values of my ComboBo box, there shouldn't be an issue there.

 

Thank you!

emh
Level 8

Re: ComboBox Default Property - formula not working

My pleasure. Glad it worked out.

 

It is helpful to mark this issue as solved so others can search on it.

simms7400
Level 8

Re: ComboBox Default Property - formula not working

@emh  No, it doesn't work.

 

This validates in the DefeaultSelectedItems property:

LookUp(RD_Target_List, Name=Concatenate("PFR-",DataCardValue25.Text))

But it doesn't render anything. As I need to actually return the "Business_Owner" value from the "RD_Target_List" table based on the name.

 

This is the fomrula that works as expected on a text box that I want to work on the combobox but doesn't:

LookUp(RD_Target_List, Name=Concatenate("PFR-",DataCardValue25.Text), Business_Owner)

 

 

 

 

 

panand99
Level 10

Re: ComboBox Default Property - formula not working

Hi @simms7400 ,

 

Use your lookup formula in "Collection" and use that collection in combobox items. It will work.

 

Highlighted
simms7400
Level 8

Re: ComboBox Default Property - formula not working

@panand99  Hi There!

 

What do you mean? Are you suggestion I make a collection? Where would I put that though?

panand99
Level 10

Re: ComboBox Default Property - formula not working

You can put that collection on screen on start if this lookup value is default when form load or you can create collection in filed change event if it is a selection field.
simms7400
Level 8

Re: ComboBox Default Property - formula not working

@panand99  HI -

 

So I made this collection:

collection.jpg

 

And placed this formula in my DefaultSelectedItems property and it validates, but doesn't return anything even though it should. Am I doing anything wrong?

LookUp(ListElements, Name=Concatenate("PFR-",DataCardValue25.Text), Business_Owner)
simms7400
Level 8

Re: ComboBox Default Property - formula not working

@RandyHayes 

 

Calling in the heavy hitter for this question 🙂

 

Randy I know we went over ComboBox "woes", but can't seem to get it to work with anything I tried. Any and all help is greatly appreciated!!

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 (Last 30 Days)
Users online (3,895)