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 / Problem with Startswit...
Power Apps
Unanswered

Problem with Startswith on OnSelect

(1) ShareShare
ReportReport
Posted on by 4
Good evening everyone,

I have a problem with a button. I would like to filter which screen to navigate to based on the first letter.
The code is attached:
If(
    StartsWith(Label3_4.Text; "K");
        Set(varFolderPathK; "EinkaufK/");
        Set(varFolderPathVariableLiefK;Concatenate(varFolderPathK; ThisItem.'Name' & "/"));
        Navigate(Screen_Variable_K);
       
    StartsWith(Label3_4.Text; "L");
        Set(varFolderPathL; "EinkaufL/");
        Set(varFolderPathVariableLiefL;Concatenate(varFolderPathL; ThisItem.'Name' & "/"));
        Navigate(Screen_Variable_L);
                 
);;

greetings



 
I have the same question (0)
  • WarrenBelz Profile Picture
    155,686 Most Valuable Professional on at
    I am not entirely clear on your logic here, but are you trying to do this
    With(
       {_Item: Left(Label3_4.Text,1)};
       Switch(
          _Item,
          "K";
          Set(
             varFolderPathVariableLiefK;
             "EinkaufK/" & ThisItem.'Name' & "/"
          );;
          Navigate(Screen_Variable_K);
          "L";
          Set(
             varFolderPathVariableLiefL;
             "EinkaufL/" & ThisItem.'Name' & "/"
          );;
          Navigate(Screen_Variable_L)
       )
    );;
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • CU29082315-0 Profile Picture
    4 on at
    Hello,
    I would like to determine the first letter from a gallery and then set a collection and 2 variables using a button, and if the letter is A, then ScreenA, if B, then ScreenB and so on.
     
    With(
       {_Item: Left(Label3_4.Text;1)};
       Switch(
          _Item;
          "K";
          ClearCollect(colEinkaufK; EinkaufK);;
          Set(varFolderPathK; "EinkaufK/");;
          Set(varFolderPathVariableLiefK; Concatenate(varFolderPathK; ThisItem.Name & "/"));;
          Navigate(Screen_Ordnerstruktur_Variable_K);
     
          "L";
          ClearCollect(colEinkaufL;EinkaufL);;
          Set(varFolderPathL; "EinkaufL/");;
          Set(varFolderPathVariableLiefL; Concatenate(varFolderPathL; ThisItem.Name & "/"));
          Navigate(Screen_Ordnerstruktur_Variable_L)
       )
    );;
  • WarrenBelz Profile Picture
    155,686 Most Valuable Professional on at
    That is what posted. What is not working ?

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 463

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
11manish Profile Picture

11manish 275

Last 30 days Overall leaderboard