Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Only showing certain choices in a form control

Like (1) ShareShare
ReportReport
Posted on 14 Jan 2025 18:55:24 by 21
Hello - 
I am building a multi-screen power app based on a SharePoint list DataSource and I have an issue that I'm hoping someone can help me with...
 
The form control in question is a choice column in SharePoint.  Here are the choices:
  1. Legal right of re-employment (e.g., following maternity or parental leave)
  2. Return from approved leave of absence (e.g., reinstatement guarantee, sabbatical
  3. Return of expatriates to their home country according to their Development Plan
  4. Priority of placements because of agreements with employee representatives
  5. Extensive departmental or divisional reorganizations that are approved by the responsible management (e.g. redeployments pools) – (this is also a deployment)
  6. Summer hires, interns, co-ops, trainees and other temporary positions
  7. Extension of contracts as well as takeover from temporary employment in the same position
  8. Post-doctoral positions
  9. All Project Manager positions with defined, time limited project assignments
  10. Short-term assignments (posting optional)
  11. Placement of trainees at the end of formal trainee programs
  12. Transfers that are intended to avoid the potential layoff or termination of qualified employee – (if it’s a potential layoff, this is also a deployment scenario)
  13. N/A
Here is how this looks in my PowerApp:
 
Here is what I want to happen - 
If Type of Request Validation reads "Posting Exception, Approvals Not Required", I want all of the choices in DataCardValue17 to show up (they are all of the choices in the choice column listed above).  If Type of Request Validation reads anything else, I want "N/A" to be the only choice.
 
The formula that I started to use in the items property for DataCardValue17 is included in the screenshot - this is not working.
 
Any other ideas on how I can get this to work?
 
Thank you!
  • JD-03091828-0 Profile Picture
    JD-03091828-0 21 on 14 Jan 2025 at 22:07:15
    Only showing certain choices in a form control
    This worked beautifully - thank you!
  • Verified answer
    Mark Nanneman Profile Picture
    Mark Nanneman 831 on 14 Jan 2025 at 20:47:52
    Only showing certain choices in a form control
    Your drop down or combobox needs an collection (array) of choices, a single string like "N/A" is not acceptable for the Items property.

    Assuming "N/A" is a valid option in your Choice Column Option Set, try this:

    (be careful, I just typed this off your image, might contain typos)

    If(
    'Type of Request Validation'.Text = "Posting Exception, Approvals Note Required",
    Choices([@'Deployment/Posting Exceptions Request'].'Posting Exception (Approvals Not Required)'),
    Filter(Choices([@'Deployment/Posting Exceptions Request'].'Posting Exception (Approvals Not Required)'), Value = "N/A")
    )

    The idea is that your default should be a filtered Choices collection where Value = "N/A".


    If this helps, give this response a like and mark it as an answer, thanks!

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,638

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,433

Leaderboard
Loading started