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

Community site session details

Session Id : mEec5ZCPoq+iWmEbPoAK2F
Power Apps - Building Power Apps
Answered

Syntax error

Like (0) ShareShare
ReportReport
Posted on 19 Apr 2023 08:52:46 by 69

Hi

I am tryng to queue multiple commands in a screen to

- create a collection

- set a function to replace accentuated characters

 

I found this formula via Bing new conversation search tool (mind  comma are replaced by semicolumn beacause french devpt interface)

Trouble is PowerApps keeps telling that it doesn't recognize StrText and so Substitute as an invalid argument

Is there something more to do to make PowerApps accepting the variable StrText  ?

 

Set(MyFunctions; {RemoveFrenchAccents: Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(StrText;"é"; "e");"è"; "e");"ê"; "e");"ë"; "e");"à"; "a");"â"; "a");"ô"; "o");"ù";"u");"û"; "u");"î"; "i");"ç"; "c")});

Categories:
  • Flejoyeux Profile Picture
    69 on 20 Apr 2023 at 15:50:25
    Re: Syntax error

    Another problem Fixed : in a French development Environment, Commands are to be separated by a double semicolumn ";;"  !

     

  • Flejoyeux Profile Picture
    69 on 19 Apr 2023 at 13:41:00
    Re: Syntax error

    Hi

    The idea is to use the function with any string

    Declaring the Variable on the OnStart properties works

  • RobHajj98 Profile Picture
    496 on 19 Apr 2023 at 13:11:28
    Re: Syntax error

    Hey @Flejoyeux ,

    Roberto_el_Hajj_0-1681909603996.png

    Set(MyFunctions, {RemoveFrenchAccents: Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute( "vidéo","é", "e"),"è", "e"),"ê", "e"),"ë", "e"),"à", "a"),"â", "a"),"ô", "o"),"ù","u"),"û", "u"),"î", "i"),"ç", "c")})

     

    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.

  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 19 Apr 2023 at 12:45:11
    Re: Syntax error

    Hi @Flejoyeux ,
    Apologies, please use below formula in OnStart property of App - 
    Set(StrText ; "")
    You can also use text input control name instead of using a variable - TextInput1.Text in place of variable.

  • Flejoyeux Profile Picture
    69 on 19 Apr 2023 at 11:51:41
    Re: Syntax error

    Hi

    I plan to use the function to relace all accents from strings coming for a Text Field and a Text Column in order to be able to filter, for example "Video" if it is either entered as "vidéo", "Video", 'video" or "Vidéo" in either of the text field (search box) or the records

     

    Your solution seems to work for the Function declaration  but there still an error in the OnVisible parameter of the Screen part wich is generated by the semicolumn at the end of the formula settings

     

    is the syntax to queue command  different in a French environnement ?

     

    Set(MyFunctions; {RemoveFrenchAccents: Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(StrText;"é"; "e");"è"; "e");"ê"; "e");"ë"; "e");"à"; "a");"â"; "a");"ô"; "o");"ù";"u");"û"; "u");"î"; "i");"ç"; "c")});
    ClearCollect(BoiteaOutils;Documents)

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 19 Apr 2023 at 11:19:12
    Re: Syntax error

    Hi @Flejoyeux ,
    Can you please let me what value you are setting in "StrText" variable and where are you adding the formula to set value to "StrText" variable.
    You can set StrText OnStart to blank - Set(StrText,"") and try running OnStart function.


  • Flejoyeux Profile Picture
    69 on 19 Apr 2023 at 09:08:44
    Re: Syntax error

    Flejoyeux_0-1681895209061.png

    A screen capture of the error displayed

    I seems that the StrTexte name is not automatically recognized as a  local variable as it should

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473