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 / Filtering Status Reaso...
Power Apps
Answered

Filtering Status Reason options by Selected Status

(0) ShareShare
ReportReport
Posted on by 23

Hi there,

 

I am creating a popup in a canvas app that will allow a user to close a lead. There are two options for an inactive Status (Qualified and Disqualified) and each of these have their own associated Status Reasons.

 

Is it possible to filter the Status Reason choices based on the Status selection?

 

Current expression doesn't give errors, but also doesn't show any options in the Status Reason option set. (DataCardVAlue59 is the Status Drop Down option set. This is from the Items for the Status Reason option set.)

 

If(DataCardValue59.Selected.Value = 'Status (Quotes)'.Qualified, Filter(Choices('Status Reason (Quotes)', 'Status Reason (Quotes)'), Status='Status (Quotes)'.Qualified), Filter(Choices('Status Reason (Quotes)', 'Status Reason (Quotes)'), Status='Status (Quotes)'.Disqualified))

 

Cath_Tatham_1-1595572877513.png

Cath_Tatham_3-1595572940775.png

 

Thanks.

 

Kind regards,

Cath

 

 

 

Categories:
I have the same question (0)
  • Joel CustomerEffective Profile Picture
    3,224 on at

    No, the relationship between these two picklists is not accessible from canvas apps. I would recommend creating a collection with these values and their relationship

     

    Abe Saldona wrote a good post that shows how to update status and status reason (statecode and statuscode) via patch

    https://abesaldana.com/powerapps-canvas-using-status-fields-in-cds/

     

    Fortunately these options very rarely change.

     

    If you have the XRM toolbox, there is a utility in there called the Power BI OptionSet Assistant that puts all of the option set values in an entity making it easier to retrieve these values.

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Cath_Tatham ,

    Based on the formula that you mentioned, I think there is something wrong with it. I agree with @jlindstrom 's thought almost. If you want to filter the Status Reason choices based on the Status selection in your canvas app, I afraid that there is no direct way to achieve your needs.

    The Relationship between Status Reason choices and Status choices could not be available in canvas app currently. Regarding your formula:

    Filter(Choices('Status Reason (Quotes)', 'Status Reason (Quotes)'), Status='Status (Quotes)'.Qualified)

    the Choices('Status Reason (Quotes)') formula would return a table value contains only the "Value" column, there is no column called "Status" in the Choices('Status Reason (Quotes)') formula result, so you could not specify the Status column as Filter column in your Filter function.

     

    As an fixed solution, you could consider collect the Status option and related Status Reason Options in a collection, and then compare the DataCardValue59 selected option with the collection table. I have made a test on my side, please try the following workaround:

    Set the OnStart property of App to following:

    ClearCollect(
     StatusCollection,
     {'Status Value': 'Status (Quotes)'.Qualified, Value: 'Status Reason (Quotes)'.'Best Rates'},
     {'Status Value': 'Status (Quotes)'.Qualified, Value: 'Status Reason (Quotes)'.'Favours ..'}, // replace 'Favours ..' with actual option value here from your Option Set
     {'Status Value': 'Status (Quotes)'.Qualified, Value: 'Status Reason (Quotes)'.'Superior Service'},
     {'Status Value': 'Status (Quotes)'.Qualified, Value: 'Status Reason (Quotes)'.'No Reason Provided'},
     {'Status Value': 'Status (Quotes)'.Disqualified, Value: 'Status Reason (Quotes)'.'Lost to Competitor'},
     {'Status Value': 'Status (Quotes)'.Disqualified, Value: 'Status Reason (Quotes)'.'No Feedback'},
     {'Status Value': 'Status (Quotes)'.Disqualified, Value: 'Status Reason (Quotes)'.'Client Declined Cover'},
     {'Status Value': 'Status (Quotes)'.Disqualified, Value: 'Status Reason (Quotes)'.'Canceled'},
     {'Status Value': 'Status (Quotes)'.Disqualified, Value: 'Status Reason (Quotes)'.'No Reasons Provided'},
     {'Status Value': 'Status (Quotes)'.Disqualified, Value: 'Status Reason (Quotes)'.'Other'}
    )

     

    Then set the Items property of the Status Reason ComboBox to following:

    Filter(
     Choices('Status Reason (Quotes)'),
     Value in Filter(StatusCollection, 'Status Value' = DataCardValue59.Selected.Value).Value
    )

    Note: I assume that the 'Status Reason (Quotes)' represents the Option Set in your CDS.

     

    Please re-load your canvas app, then check if above solution could fix your issue.

     

    Also please check and see if the blog @jlindstrom  provided above would help in your scenario.

     

    Regards,

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 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard