cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,388)