cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Update Value: Combobox

I'm having a bit of trouble and so I figured it would be easier to just ask for help.  I have a form using two data sources: FuelingApp and Fixed Assets.

 

The form itself uses FuelingApp to store the data. However, for this field I am using the FixedAssets database so I can pull the asset from a dropdown.  I set the combobox to only allow one selected item.  I am using the formula ComboBox2.Selected.Description under update.    Here is what the combobox looks like from a user perspective.

 

Screenshot1 - Asset ID.png

 

Here is the actual update code:  

  

Screenshot 2 - Asset ID Update.png

 

Since nothing is submitting.  I tried to create a label with the formula to ensure it is working correctly.  It is.

Screenshot3 - Label test.png

Here is my data. Line 23,24,25 are all new entries that are using the combobox instead of the dropdown. Line 26 was me attempting to test something else.  

 

Screenshot - 4 Data.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User II
Super User II

Hi @dyee4613,,

It sounds like you are making it more complicated than it needs to be.  Combobox and Dropdown controls select a record and show a single field in the window of the control, but regardless of what is displayed, all of the fields in the record can be referenced. In the case of your Form, you would unlock the Description card and put the combobox control inside the Description card.   Then change the Update property of that card to Combobox2.Selected.Description.  When you submit the form, the Description from the combobox will be saved regardless of what is shown in the window of the control. 

 

View solution in original post

Thanks for screens and clarification. I think I know what it's all about.

 

So I will reference to following:

"1- When I submit form, I want the AssetID field to be populated with the combobox's selected value

2- I want the combobox's value to be referenced in the last odometer entry

3- I want combobox's value to be referenced in the asset type lookup."


@1&@3: to achieve this you only need to use FormEdit control set as "new". So as below (I'm using

  • FlooringEstimates collection):

image.png

  • Pick fields you want to edit (when creating new form)
    image.png
  • Here is a tricky part: In my case I would like to change the control type of Overview field. To do this I need to customize card (it's very well described in this article). Just follow article. In my case my field looked like this:
    image.png
    And after customization it looked like this:
    image.png
  • After saving it and submiting form my values were properly propagated (Hello world was my bad try 🙂 )
    image.png

@2: This one is tricky here. Mainly because OneDrive excel is not delegated. Which means you can search for item through max of 2000 items (if your item will be on 2001 position you will not get it 😞 ). But it can be easily workarounded - just save last odometer value in extra table in the excel (i.e. Last values) and update it every time you save new row.

 

I hope I helped you in a bit 🙂 

View solution in original post

6 REPLIES 6
Super User II
Super User II

Hi @dyee4613,,

It sounds like you are making it more complicated than it needs to be.  Combobox and Dropdown controls select a record and show a single field in the window of the control, but regardless of what is displayed, all of the fields in the record can be referenced. In the case of your Form, you would unlock the Description card and put the combobox control inside the Description card.   Then change the Update property of that card to Combobox2.Selected.Description.  When you submit the form, the Description from the combobox will be saved regardless of what is shown in the window of the control. 

 

View solution in original post

Kudo Kingpin
Kudo Kingpin

Hm, can you be more specific on what you want to achieve? Select single value from combo box and pass it to patch function? 

 

Btw when you write ComboBox1.SelectedItems.Value it will returns you a collection. So what you need to do is to go with

  • First(ComboBox1.SelectedItems).Value
  • OR
  • First(ComboBox1.SelectedItems.Value).Value

Hi @Drrickryp

 

I'm sorry I don't think my original post was very clear.  I went back and added screenshots.  I think I did exactly what you suggested (unless I'm misreading your post).  I am also trying to use the vaule of asset ID for the following formulas.

 

- LookUp(FixedAsset,AssetID = ComboBox2.Selected.Description,AssetType)

- Max(Filter(Table1,AssetID=ComboBox2.Selected.Description),Odometer)

 

The max filter used to work when it was datacardvalue.text.  

 

Thank you! 

 

@Mike_GuzowskiI'm sorry for the confusion.  I'm still pretty new to PowerApps so it's difficult to articulate things concisely.  I want to reference the value of the combobox in three ways.

1- When I submit form, I want the AssetID field to be populated with the combobox's selected value

2- I want the combobox's value to be referenced in the last odometer entry

3- I want combobox's value to be referenced in the asset type lookup.

 

In regards to your solution, I will try it out but I set the combobox to only allow a single entry.  As a result, I don't think first will do anything because there is only one allowable entry opposed to normal comboboxes which can allow multiple options.  I appreciate your feedback!

 

Update: I tried both options.  PowerApps gave me an error message for both.

Combined both answers into the above post.  Not sure how to delete this post.

Thanks for screens and clarification. I think I know what it's all about.

 

So I will reference to following:

"1- When I submit form, I want the AssetID field to be populated with the combobox's selected value

2- I want the combobox's value to be referenced in the last odometer entry

3- I want combobox's value to be referenced in the asset type lookup."


@1&@3: to achieve this you only need to use FormEdit control set as "new". So as below (I'm using

  • FlooringEstimates collection):

image.png

  • Pick fields you want to edit (when creating new form)
    image.png
  • Here is a tricky part: In my case I would like to change the control type of Overview field. To do this I need to customize card (it's very well described in this article). Just follow article. In my case my field looked like this:
    image.png
    And after customization it looked like this:
    image.png
  • After saving it and submiting form my values were properly propagated (Hello world was my bad try 🙂 )
    image.png

@2: This one is tricky here. Mainly because OneDrive excel is not delegated. Which means you can search for item through max of 2000 items (if your item will be on 2001 position you will not get it 😞 ). But it can be easily workarounded - just save last odometer value in extra table in the excel (i.e. Last values) and update it every time you save new row.

 

I hope I helped you in a bit 🙂 

View solution in original post

@Mike_Guzowski  Thanks for your reply.  I was able to figure it out.  I'm not exactly sure what I did but here are the steps I took to solve it.

 

1) I removed my assetID field and readded it.  I redid the same steps as before.  For some reason, my formula started to work.

2) The lookup was using items from the FixedAsset database but I was using the FuelingApp database. After I fixed this, the values started to pull up without an issue

3) The max worked fine already.  I just wasn't able to test it because it wasn't storing the value.

 

I really appreciate all the help guys.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (61,027)