cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aaroh_bits
Resolver I
Resolver I

Show fields depending on dropdown

Hi All,

 

I have requirement where if dropdown called Cost Recoverable is Yes Then I have to ask used to fill in Customer name and Customer PO Number, and if  Cost Recoverable is No, I have to set Customer Name and Customer PO Number as NA.

The data is coming from Dataverse tables .

Something like this.

 

  • If a User selects Yes, then Customer name and Customer PO Number MUST BE  filled in as follows:

    01 Yes.jpg
  • And if use selects No from drop down then Customer name & Customer PO Number MUST BE populated as NA as default as follows:


    02 No.jpg
  • How could I achieve this?  Please advice. 

    @jinivthakkar @v-xiaochen-msft  @v-xida-msft 


1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @aaroh_bits 

 

It looks like you are using the textinput control on ‘Customer name’ and Customer PO Number’.

I suggest you use the Default property of the label control instead of the Visible property.

 

I made a simple example for you.

1\ This is my test list ‘LIST70’. ‘Customer name’ and ‘Customer PO Number’ are Single line of text columns. ‘Cost Recoverable’ is a choice column.

v-xiaochen-msft_0-1612854266074.png

 

 

2\ Set the DataCardValue4 ‘s OnChange property to:

Reset(DataCardValue6);Reset(DataCardValue7)  // DataCardValue6 is the control of Customer name. DataCardValue7 is the name of Customer PO Number.

 

3\ Set the Default property of DataCardValue6 to:

If(DataCardValue4.Selected.Value = "Yes", Parent.Default, "NA")

 

Set the DisplayMode property of DataCardValue6 to:

If(DataCardValue4.Selected.Value="Yes", Parent .DisplayMode,DisplayMode.View)

 

4\ Set the Default property of DataCardValue7 to:

If(DataCardValue4.Selected.Value = "Yes", Parent.Default, "NA")

 

Set the DisplayMode property of DataCardValue7 to:

If(DataCardValue4.Selected.Value="Yes", Parent .DisplayMode,DisplayMode.View)

 

5\ The result is as follows:

AAA.gif

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

4 REPLIES 4
jinivthakkar
Dual Super User
Dual Super User

@aaroh_bits please check this https://www.youtube.com/watch?v=pkZG2boN7jQ

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thaanks @jinivthakkar  for your reply. 

Thanks for providing the Shane’s video

  • My requirements are slightly different.

  • I am trying with Customer Name and Customer PO number Visible properties.

  • If Cost is Yes, then I set Customer Name and Customer PO number visible property as follows:
    If( DataCardValue4.Selected.Value exactin "Yes", true, false) Or If(DataCardValue4.Selected.Value exactin "No", false, true)

    Cost Recoverable
    (1) is the drop down with DataCardValue4 (2).
    I am using Customer Name datacard’s value DataCardValue5 (3) and leveraging Visible property (4,5)  which works well
    aaroh_bits_0-1612850314338.jpeg

     



    But if use a selects No from Cost recoverable fields, I need display NA for customer name and customer PO number field, which somehow I don’t know to display as these field becomes not visible in the form.


    04 of Cost is No, both text fields becomes not visible.jpg
    Any suggestion on that please?


     





v-xiaochen-msft
Community Support
Community Support

Hi @aaroh_bits 

 

It looks like you are using the textinput control on ‘Customer name’ and Customer PO Number’.

I suggest you use the Default property of the label control instead of the Visible property.

 

I made a simple example for you.

1\ This is my test list ‘LIST70’. ‘Customer name’ and ‘Customer PO Number’ are Single line of text columns. ‘Cost Recoverable’ is a choice column.

v-xiaochen-msft_0-1612854266074.png

 

 

2\ Set the DataCardValue4 ‘s OnChange property to:

Reset(DataCardValue6);Reset(DataCardValue7)  // DataCardValue6 is the control of Customer name. DataCardValue7 is the name of Customer PO Number.

 

3\ Set the Default property of DataCardValue6 to:

If(DataCardValue4.Selected.Value = "Yes", Parent.Default, "NA")

 

Set the DisplayMode property of DataCardValue6 to:

If(DataCardValue4.Selected.Value="Yes", Parent .DisplayMode,DisplayMode.View)

 

4\ Set the Default property of DataCardValue7 to:

If(DataCardValue4.Selected.Value = "Yes", Parent.Default, "NA")

 

Set the DisplayMode property of DataCardValue7 to:

If(DataCardValue4.Selected.Value="Yes", Parent .DisplayMode,DisplayMode.View)

 

5\ The result is as follows:

AAA.gif

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Thank you so much @v-xiaochen-msft ..

It worked like a charm!!  😊

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,322)