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 Apps
Unanswered

Syntax Code error

(0) ShareShare
ReportReport
Posted on by 10

Hi , i have an error on my code.

I have 2 columns, a "BUDGET" column with a drop-down list, and an "CODE_ARTICLE" column with a drop-down list.

 

I want to create a condition: if the "BUDGET" column = "Masse_salariale", then I want the "CODE_ARTICLE" column to display only the codes that start with "Masse salariale".

 

Here is my code : 


If(DataCardValue1.Selected.Value = "Masse_salariale"; Filter([@'Trame budget programmes courts'].CODE_ARTICLE; StartsWith(CODE_ARTICLE.Value; "Masse salariale")); Choices([@'Trame budget programmes courts'].CODE_ARTICLE)
)

 

Where is the syntax mistake pls ?

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,250 Super User 2026 Season 1 on at

    Hi @Power_appsFR , Please try this

     

     

    If(DataCardValue1.Selected.Value = "Masse_salariale", 
     Filter('Trame budget programmes courts', 
     StartsWith(CODE_ARTICLE.Value, "Masse salariale")
     ), 
     Choices('Trame budget programmes courts'.CODE_ARTICLE)
    )

     

     

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,

    ANB

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    Hi @Power_appsFR ,

    Try this format

    If(
     DataCardValue1.Selected.Value = "Masse_salariale"; 
     ShowColumns(
     Filter(
     AddColumns(
     'Trame budget programmes courts';
     "Value";
     CODE_ARTICLE.Value
     ); 
     StartsWith(
     Value;
     "Masse salariale"
     )
     ); 
     "Value"
     );
     Choices([@'Trame budget programmes courts'].CODE_ARTICLE)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Power_appsFR Profile Picture
    10 on at

    Hi Warren, I've finally found the good code which works . However how can I add other possibilities (e.g : if "budget" = "transport" , so "CODE_ARTICLE" must show only codes which start by "TR" , and then with other options.

     

     

    If(
    DataCardValue1.Selected.Value = "Masse_salariale";
    Filter(
    Choices('Trame budget programmes courts'.CODE_ARTICLE);
    StartsWith(
    Value;
    "MS"
    )
    );
    Choices([@'Trame budget programmes courts'].CODE_ARTICLE)
    )

  • Power_appsFR Profile Picture
    10 on at

    this code works :

     

    If(
    DataCardValue1.Selected.Value = "Masse_salariale";
    Filter(
    Choices('Trame budget programmes courts'.CODE_ARTICLE);
    StartsWith(
    Value;
    "MS"
    )
    );
    Choices([@'Trame budget programmes courts'].CODE_ARTICLE)
    )

  • Power_appsFR Profile Picture
    10 on at

    this code works :

     

    If(
    DataCardValue1.Selected.Value = "Masse_salariale";
    Filter(
    Choices('Trame budget programmes courts'.CODE_ARTICLE);
    StartsWith(
    Value;
    "MS"
    )
    );
    Choices([@'Trame budget programmes courts'].CODE_ARTICLE)
    )

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    Hi @Power_appsFR ,

    You can add the other choices in the top section

    With(
     {
     _Choice:
     Switch(
     DataCardValue1.Selected.Value;
     "Masse_salariale";
     "MS";
     "Transport";
     "TR"
     )
     };
     Filter(
     Choices('Trame budget programmes courts'.CODE_ARTICLE);
     IsBlank(_Choice) ||
     StartsWith(
     Value;
     _Choice
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard