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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Is it possible to use ...
Power Apps
Unanswered

Is it possible to use arguments in Power Fx Named Formulas?

(0) ShareShare
ReportReport
Posted on by 2,295

Is it possible to use arguments in Power Fx Named Formulas?

 

For example, I need to translate a piece of text into English, with something like:

 

Translate("Alguna cosa", "en-US")

So, assuming I have a localization static collection, like:

 

TextLanguage
Alguna cosaes-ES
Somethingen-US

 

How to define the Translate formula?

 

Tanslate = Loookup( Localization, Text = Arg1(text) && Language = Arg2(langCode)).Text

 

Categories:
I have the same question (0)
  • timl Profile Picture
    36,391 Super User 2025 Season 2 on at

    It's not possible to pass arguments to Power FX named formulas.

    However, this feature is on the roadmap and the 2023 Wave1 document states a public preview date of June 2023 for this feature.

    Hi @WebPortal 

  • WebPortal Profile Picture
    2,295 on at

    @timlthank you for letting me know 🙂

  • HEATFreight Profile Picture
    1,024 on at

    Regarding

    It's not possible to pass arguments to Power FX named formulas.


    I have had good experiences with a named formula that references a SharePoint lookup. The logic is 

    Refresh(SharePointListName);
    Set(varfSharePointLookup, fSharePointLookup);


    where the formula is

    fSharePointLookup = Lookup(SharePointListName,filter1 = "filter condition");


    with the caveat that on the loading screen you should use something like

    Set(varfSharePointLookup, Lookup(SharePointListName,filter1 = "filter condition");


    Or that's what I did because I was not having any luck using named formulas in the app startup and first load of the data.

    Does anyone know if named formulas work when referenced in the startup code? My startup code runs in a button on the loading screen that gets selected automatically upon LoadingScreen.Visible=true. Seemed like named formulas were not working in that context.

  • HEATFreight Profile Picture
    1,024 on at

    I think maybe I had an error in my code that prevented my named formulas from working because something was declared out of order. It's working for me now on startup! My code is much simpler and now I don't have to repeat myself so much! Wish named formulas could take arguments!

  • HEATFreight Profile Picture
    1,024 on at

    Aha! Ok I think I have resolved my issue of the formula on startup problem. It seems that you must pre-reference the SharePoint list if your named formula references a list and especially if it is called on startup. If there is nowhere else that will have already established the outgoing connection to that SharePoint list, the formula won't initiate it —at least not on startup. I'm not entirely certain if refreshing is always necessary, but I have made sure to use 'Refresh(SharePointListName);' before all named formula calls, which works great for my use case.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard