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

Set "Display mode" of combo box on form to "View" is LastSubmit not empty.

I have a form (see attached) that allows users to submit visitor details and then displays the result in a gallery below.  The user can submit multiple visitors, but the "host" and "Visiting Site" fields will always be the same as the first form submitted.   I have this part working with a "LastSubmit.host", etc. formula, which when the form is submitted, it pre-populates the "Host" & "Visiting Site" fields, leaving the remaining fields empty. This works fine, but it would be nice for the "Host" and "Visiting Sites" fields "Display Mode" to switch from "Edit" to "View" to prevent users changing the pre-poplated values, but I cant figure this out.

 

I have tried...   

 

If(IsBlank(Visitor_Registration_Form.LastSubmit.Host), DataCardValue14_1.DisplayMode.Edit, DataCardValue14_1.DisplayMode.View);

 

on various canvas and item parameters, but cant figure it.  Help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Set "Display mode" of combo box on form to "View" is LastSubmit not empty.

Hi @StuartSmith ,

Where do you put your If formula?

Could you please share a bit more about the "Host" field and "Visitig Site" field within your SP List data source?

 

Based on the formula that you mentioned, I think there is something wrong with it. Currently, within PowerApps, we could not assign value to a property of one control within another control.

 

Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

Set the OnSuccess property of the your Visitor_Registration_Form to following:

Set(SubmittedRecord, Visitor_Registration_Form.LastSubmit)

Set the DisplayMode property of the Host ComboBox (DataCardValue14_1) to following:

If(
   !IsBlank(SubmittedRecord.Host.Value),
    DisplayMode.View,
    DisplayMode.Edit
)

or

If(
   !IsBlank(SubmittedRecord.Host),
    DisplayMode.View,
    DisplayMode.Edit
)

or

If(
   !IsBlank(Visitor_Registration_Form.LastSubmit.Host),
    DisplayMode.View,
    DisplayMode.Edit
)

Note: Same logic for "Visiting Site" ComboBox.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

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
Community Support Team
Community Support Team

Re: Set "Display mode" of combo box on form to "View" is LastSubmit not empty.

Hi @StuartSmith ,

Where do you put your If formula?

Could you please share a bit more about the "Host" field and "Visitig Site" field within your SP List data source?

 

Based on the formula that you mentioned, I think there is something wrong with it. Currently, within PowerApps, we could not assign value to a property of one control within another control.

 

Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

Set the OnSuccess property of the your Visitor_Registration_Form to following:

Set(SubmittedRecord, Visitor_Registration_Form.LastSubmit)

Set the DisplayMode property of the Host ComboBox (DataCardValue14_1) to following:

If(
   !IsBlank(SubmittedRecord.Host.Value),
    DisplayMode.View,
    DisplayMode.Edit
)

or

If(
   !IsBlank(SubmittedRecord.Host),
    DisplayMode.View,
    DisplayMode.Edit
)

or

If(
   !IsBlank(Visitor_Registration_Form.LastSubmit.Host),
    DisplayMode.View,
    DisplayMode.Edit
)

Note: Same logic for "Visiting Site" ComboBox.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,266)