web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Visibility of form dep...
Power Apps
Answered

Visibility of form depending on value of other form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

I have two forms on one page in an app and I want to show specific fields depending on a selection of a dropdown menu in another form. All my data is stored in Dataverse. 

 

What I want to achieve with my app, is that depending on the amount of departments you select, fields for the information of the departments are visible or not. So for example if I select "3", that I can enter the information of 3 departments. When I select "1", then I can only enter the information of one department. 

 

I tried first in the visible control: DataCardValue6_2.Selected.Value = "2", for the fields of information of the second department. It didn't work, so I assumed there is a problem of passing the value between two forms. I stored the DataCardValue6_2.Selected.Value in a global variable as I put in the OnSelect control of the dropdown menu: Set(varDepartmentSelected; DataCardValue6_2.Selected.Value) and then put in the visible control of the department fields: varDepartmentSelected = "2", but it doesn't work. 

 

Can somebody help me here?

 

Thanks in advance

Categories:
I have the same question (0)
  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Try using the LastSubmit Function like this:

    FormName.LastSubmit.ColumnName.

    That will get you the value you need.

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @phipps0218

    thanks for the advice!

    The problem is, that the forms aren't submit. Both forms are on the same page and I want to store the data in the end with one button click. So the data of the dropdown menu isn't submit to the data, but I want a changing form display based on the selection of the dropdown menu.

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Then in that case you can do it from the dropdown itself or by setting a variable in the first form and then using this variable value in the second form.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    But how? I tried it with a global variable and it seems, that I can't get the right formula in the Visible control of the fields. 

     

    First I saved the dropdown value in a variable with the OnSelect control: Set(varDepartmentSelected; DataCardValue6_2.Selected.Value)

    Then I put in the visible control of the fields in the second form: varDepartmentSelected = "2", but I gives me an error

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    What is the error?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Some types are incompatible for comparison. These types cannot be compared. OptionSetValue(Number of Departments), Text

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried also to just compare it with the 2, as a number, but it's the same error. But the global variable is correctly saved. The value is 2

  • Verified answer
    MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    When comparing the variable value can you try wrapping it in Text() so then you compare text vs text?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It worked! Thanks a lot! I knew that I was missing something and wasn't close to a solution.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard