I have employed the Named Formula property on an app with the following definitions:
fxRed = ColorValue("#EA0437");
fxWhite = ColorValue("#ffffff");
fxBlack = ColorValue("#000000");
fxDarkBlue = ColorValue("#00587C");
fxCyanBlue = ColorValue("#5a7e92");
fxBlue = ColorValue("#0099d8");
fxCyanGreen = ColorValue("#63c7b7");
fxYellow = ColorValue("#ffda00");
fxHeader = Switch(
App.ActiveScreen.Size,
6,
20,
5,
18,
4,
16,
3,
14,
2,
12,
1,
10
);
fxBody = Switch(
App.ActiveScreen.Size,
6,
16,
5,
14,
4,
12,
3,
10,
2,
8,
1,
8
);
fxEnvironment = Text(
//"PROD"
"DEV"
//"UAT"
);
fxAppGUID = Switch(
fxEnvironment,
"PROD",
GUID("*******-****-****-****-5fa8c525548f"),//PROD App
"DEV",
GUID("*******-****-****-****-db7013ca5fd8"),//DEV App
"UAT",
GUID("*******-****-****-****7b8fa40ee46c")//UAT App
);
fxAppURL = Concatenate(
"https://apps.powerapps.com/play/",
fxAppGUID
);
fxAppLinkURL = Concatenate(
fxAppURL,
"?record=",
locCurrentRecord.ID
);
fxUserProfile = Office365Users.MyProfileV2();
fxPermissions = Filter(
E8D_UserPermissions,
Active
);
fxRole = LookUp(
fxPermissions,
'Unique Principal Name' = fxUserProfile.userPrincipalName,
Role.Value
);
fxBugLink = Text("https://kochprod.service-now.com/compass/?id=sc_cat_item&table=sc_cat_item&sys_id=*********************************");
fxBILink = Text("https://app.powerbi.com/groups/me/apps/*******-****-****-****-4e2148916925/reports/*******-****-****-****-bccb3efe1e39/ReportSectionf83595481400197e66d4?ctid=*******-****-****-****-0989b89dfdb4");
fxDataTypes = Table(
{FieldType: "Single"},
{FieldType: "Multiple"},
{FieldType: "Choice"},
{FieldType: "Date"},
{FieldType: "Bit"},
{FieldType: "User"}
);
fxIssueIDBase = Value(2300);
When published the app will not load and only displays a loading spinner. If I regress the Named Formula feature back to disabled, the app will load correctly. Is this a matter of the contents of the Named Formulas property that I have in the sample code, or a problem with the feature in general?
Solved! Go to Solution.
So, it turns out that if I remove the named formulas that are referencing other named formulas that app works fine. I also found I cannot have a variable (local or global) in a named formula either.
fxAppGUID = Switch(
fxEnvironment,
"PROD",
GUID("*******-****-****-****-5fa8c525548f"),//PROD App
"DEV",
GUID("*******-****-****-****-db7013ca5fd8"),//DEV App
"UAT",
GUID("*******-****-****-****7b8fa40ee46c")//UAT App
);
fxAppURL = Concatenate(
"https://apps.powerapps.com/play/",
fxAppGUID
);
fxAppLinkURL = Concatenate(
fxAppURL,
"?record=",
locCurrentRecord.ID
);
fxUserProfile = Office365Users.MyProfileV2();
fxPermissions = Filter(
E8D_UserPermissions,
Active
);
fxRole = LookUp(
fxPermissions,
'Unique Principal Name' = fxUserProfile.userPrincipalName,
Role.Value
);
I don't see anything crazy in your formulas at all. Is it something to do with the ActiveScreen.Size? Can you try to just remove those formulas but keep the others intact? We'll also do some testing on our side but anything to narrow down the problem for us to try and replicate would be helpful.
For me, if I enable Named Formulas and refresh the app, the App.Formulas property only comes up in the advanced pane if I specifically search for it, not by default, and can't be found in the dropdown to the left of the formula bar. When I type anything in it, it doesn't get saved. If I then relaunch the app, I get "WebAuthoring abnormal termination." error and I have to restore a previous version to be able to use it again.
Update: this is only happening when the enhanced formula bar is turned on
Thanks for reporting that. Unfortunately that enhanced formula bar is going away so we won't be fixing this issue. There is a new experimental refresh of the formula bar actively in the works, and we'll ensure named formulas work as expected there.
WHY do you retire something that has many useful features that the default does NOT?
Examples:
NGL the navigation we have attm is pure cancer no way of saying it nice. Can't we just open this as a VS (code) project? may i overlooked it? haven't checked for a while...
Edit: there is, still pretty much a blob.
So, it turns out that if I remove the named formulas that are referencing other named formulas that app works fine. I also found I cannot have a variable (local or global) in a named formula either.
fxAppGUID = Switch(
fxEnvironment,
"PROD",
GUID("*******-****-****-****-5fa8c525548f"),//PROD App
"DEV",
GUID("*******-****-****-****-db7013ca5fd8"),//DEV App
"UAT",
GUID("*******-****-****-****7b8fa40ee46c")//UAT App
);
fxAppURL = Concatenate(
"https://apps.powerapps.com/play/",
fxAppGUID
);
fxAppLinkURL = Concatenate(
fxAppURL,
"?record=",
locCurrentRecord.ID
);
fxUserProfile = Office365Users.MyProfileV2();
fxPermissions = Filter(
E8D_UserPermissions,
Active
);
fxRole = LookUp(
fxPermissions,
'Unique Principal Name' = fxUserProfile.userPrincipalName,
Role.Value
);