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

Need help setting Update value from combo box selection

I have an approval app that has a SPO list (of requests) as it's datasource.  I have another SPO list (in the same SPO site) that has a list trainings and who is an approver for each type of training.  When an approver opens the app, a collection is generated that lists all of the training types they are authorized to approve.  If the approver clicks on a request, they are navigated to another screen with an approval form, populated by the request's details.  In the form, there is a combo box that is editable.  I currently have it set to display the requested training type (that was selected when the request was created).  Since the combo box is editable (and it needs to be), the value of the combo box selection can change by the approver selecting a different training type before submitting the approval form.  

How do I set the datacard's Update value so that it captures either the default selection (ie the approver does not change the selection) or a new selection (ie approver does change the selection)?

 

Currently, I have the DefaultSelectedItems property set to {Value: RequestReviewGallery.Selected.'Training Type'}.   I tried putting ComboBox3.Selected.Title into the Default property, but got an Expects Record Value error.  

 

Bottom line is, I need SubmitForm to get the combo box's selection value whether the combo box is touched or not.

 

Any help is appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Need help setting Update value from combo box selection

@v-siky-msft

OK, so I think I found a workaround.  In the OnVisible property of the screen, I set a variable (var_TrainingType) via UpdateContext() and made the value RequestReviewGallery.Selected.'Training Type'.  Which, if you recall is also the value of the DefaultSelectedItems property of the combo box.  Then, on the OnChange property of the combo box, I set the same variable's value to ComboBox3.Selected.Title.  After that,  I set the Update property of the Training Type datacard to the variable.  When I set my label's text value to the datacard's Update property....it works!  Unfortunately, I still can't get the value from LastSubmit when I use SubmitForm.  It's not the only datacard that doesn't seem to be getting captured.  Another datacard, whose value is text, doesn't update either.  Thoughts?

View solution in original post

12 REPLIES 12
Super User
Super User

Re: Need help setting Update value from combo box selection

Hey @lumberjacklurch, try ComboBox3.Selected. That will use the record instead of the single Title field. Let me know if that fixes things or not and I’ll follow up if needed!

v-siky-msft
Level 8

Re: Need help setting Update value from combo box selection

Hi @lumberjacklurch ,

 

To better understand your issue:

1. What is data type of the column for combo box to select? Which data source does it belong to?

2. What is the relationship of two SPO list?

I assume the requested training type column is a look up column, which is related to the SPO list containing list trainings and approvers.

If you want to show defaults values of combo box, you should set DefaultSelectedItems property as below, no need to set Defaults property.

RequestReviewGallery.Selected.'Training Type'

And the Update property of datacard should be set as below(Custom datacard have no Update property.)

ComboBox3.Selected

Please have a try and check if your issue is fixed.

Best regards,

Sik

Re: Need help setting Update value from combo box selection

@v-siky-msft

Thank you for the reply.  

 

1. The data type of the column is Single line of text

2. The first list (Requests) is the list of requests. The second (Training Types) is a list of training types and the approver for each one.

3. I tried ComboBox3.Selected in the Update property, but it doesn't seem to work.  I have a label that it's Text property is set to ApprovalFormTrainingType.Update, and it's blank.  Even though I can see the request's training type populated in the combo box.

Re: Need help setting Update value from combo box selection

This is the issue I'm up against.  When an approver selects a request in a gallery and clicks on the Approve button, they are navigated to the approval form and the combo box is populated with the request's training type value.  It's this default value that is not being recognized by the Update property.

Re: Need help setting Update value from combo box selection

@wyotim

Thank you for the reply.  Looks like you and @v-siky-msft are on the same page.

v-siky-msft
Level 8

Re: Need help setting Update value from combo box selection

Hi @lumberjacklurch ,

 

1. What it the data source of approval form? Request list?

2. What is the items property of Combo box?

3. Do both lists contain Traning type column(Text type)?

It might be easier to understand if you have detailed screenshots or formulas.

I presume that the data source of combo box is the Training types of Training Types list, and then you want to submit the selection to Request list, also you want the combo box to display the defaults values, RIGHT?

If my assumption is right, please refer to the following formuals, if not , please post more intuitive details.

set items property of Combo bo as below

'Training Types list'

set DefaultSelectedItems property as below

LookUp('Training Types list','Traning type column'=ThisItem.'Traning type column')

set Update property as below

ComboBox1.Selected.'Traning type column'

Best regards,

Sik

 

Re: Need help setting Update value from combo box selection

@v-siky-msft 

1.  Yes, the datasource of the approval form is the Requests list.

 

2.  The combo box's Items property is set to:

 

col_CurrentUserSubjs

 

3.  Yes, both lists have a training type column.  In the Requests list, the column is called 'Training Type'.   In the Training Type list, it's the Title column.

 

The datasource of the combo box is a collection which is the training type list filtered by the present user's (the approver's) email.

ClearCollect(col_CurrentUserSubjs, Filter(col_TrainingTypes, var_CurrentUserEmail in Approver.Email))

 

 

v-siky-msft
Level 8

Re: Need help setting Update value from combo box selection

Hi @lumberjacklurch ,

 

Please try with the following formulas:

set DefaultSelectedItems property as below

LookUp('Training Type list',Title=ThisItem.'Training Type')

set Update property as below

ComboBox1.Selected.Title

Best regards,

Sik

 

Re: Need help setting Update value from combo box selection

@v-siky-msft

Thank you for the reply.  I tried the formula for the DefaultSelectedItems, but it returns blank.  I get no error for the Update value.  I created a label to capture the Update value (ApprovalFormTrainingTypeValue.Update), but that is blank too.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 364 members 4,710 guests
Please welcome our newest community members: