cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
remariu
Helper III
Helper III

Set variable on visible giving error

I have defined a global variable (varApprove) with a boolean condition.  I want to reset the variable to false when I navigate to a specific screen.  I have tried to use Set(varApprove, false) at the OnVisible command, but I'm getting the following error:

 

"Unexpected Characters.  The formula contains "Ident" where "PowerFXResolvedObject" is expected."

 

Does anyone know what this means?  

 

1 ACCEPTED SOLUTION

Accepted Solutions

@remariu 

 

For me, this setting comes by default as On. If so , you must use App.OnStart.

 

You say you want to explicitly turn it off?

So if you turn it off, Save the app, and then refresh the browser.

 

However, I don't know if it is going away in the future, even if the new stuff is implemented at some point. Without App.OnStart, there's currently no way to put anything there OnStart, App.StartScreen just is a new way to tell you the StartScreen and nothing else, and you can use this with App.OnStart enabled or disabled. You need to just use OnVisible of the first screen instead then if you want to have no App.OnStart. 

 

If you really want to get rid of your App.OnStart property, what you can do is have a first screen, then leave this first screen blank, put a Timer control in this first Screen, duration 100 (or if it's too low, try 500), AutoStart true, and OnTimerEnd put all your formulas that set all the variables and then as the very last line, Navigate(someOtherScreen) away from it, and never return to this screen again elsewhere in your app. You can't use Navigate in an OnVisible of a Screen directly, it won't let you do that, so the Timer is necessary.

 

To test in editor, always click Navigate to StartScreen to do so. Note that Timers may not run in the Editor directly, and might only in the Preview of the Editor, so if you don't want to use Preview, you'll need to manually click the first Screen of your app (or manually click on Navigate to StartScreen)

poweractivate_0-1665510211169.png

(yes, I have no Run OnStart option in the above - this is intentionally missing, it's exactly how it looks when the setting you referred to is turned Off)

 

and then manually click the other screen the Timer goes to (say the second screen) each time you want to test your app from a clean run directly in the editor without explicitly or necessarily "previewing" it in the editor.

 

For StartScreen just set it to the first screen of the App (or maybe even leave it blank if it lets you do so, since the default might be just to load the first screen of the app anyway, but if you want, explicitly set App.StartScreen to the first screen of the App).

 

To my knowledge and awareness, there is no App.Formulas property, nor are any of the declarative approaches described in that blog post implemented as of yet, so the above might be the closest in order to really use the new features you are talking about.

 

See if it helps @remariu 

 

 

View solution in original post

10 REPLIES 10
poweractivate
Most Valuable Professional
Most Valuable Professional

@remariu 

 

I never saw this issue before.

 

A. Try to change the variable name to something else like myVarApproval.

Does it work?

 

B. Try copying the below line exactly from this forum post, into the formula giving the error.

 

Set(myVarApprovalBool,false)

 

and then copy and paste the below line from this forum to everywhere you have the old variable name

 

myVarApprovalBool

 

Is there still an issue?

 

C. Manually retype all formulas that have the variable name anywhere in it, and use yet another variable name.

 

If none of the above helps, 

 

Try the steps below in case it helps:

 

NOTE: if the below steps actually work, they may stop working at any time in the future and you should also follow the steps at the bottom of this post to start a support ticket, especially if the following steps "seem to resolve the issue"

 

NOTE: The below previous version 3.22085.14 may no longer be available to switch to so the below steps may not work at all. 

If that's the case and nothing else above worked, you (or your administrator) should:

Create a new Power Platform Support Ticket using these steps.

 

Here are the relevant steps, just in case:

 

1. Click Settings

2. Click Support

3. Click Edit

poweractivate_3-1665316353945.png

 

4. Click dropdown Authoring version and select the oldest possible version 3.22085.14 from the dropdown

poweractivate_4-1665316390423.png

 

 

5. Click Reload + apply version

poweractivate_2-1665316347635.png

 

 

Does the issue persist after doing the above steps?

 

If the issue does not persist, it could be an indication that the current authoring version has changed something in an unexpected way. If so,

Create a new Power Platform Support Ticket

because even if reverting the authoring version works now, it may stop working at any time in the future, so you should contact support and report the issue.

 

Even if the issue doesn't persist, I recommend you should

Create a new Power Platform Support Ticket

just in case,

maybe there is still some issue, the error looks really bizarre and may indicate some issue that you should alert the support team about just in case.

 

See if it helps @remariu 

 

remariu
Helper III
Helper III

I think this may have something to do with how I'm initializing this variable.  I used to set many of my global variables at OnStart of the app, but with the abandonment of the OnStart function I can no longer use Set(varApprove, false).  I am now using Formulas and setting the variable as varApprove = false.   The removal of the OnStart functionality has caused a lot of confusion for me and I can't find any documentation on how to work around things that seemed straight forward before.  Is there another way to be setting this variable?

@remariu 

 

If you want to avoid the rules you need to know resulting from this feature  introduction in October 2021: App.StartScreen: a new declarative alternative to Navigate in App.OnStart 

 

Just  use the OnVisible property of the first Screen, and use Set(varApprove, false)

 

Then you can do it with the way you knew before.

 

Does this help @remariu ?

 

I have seen this article, but it only speaks to Navigating from App.StartScreen.  I have not found any documentation on other functions such as setting variables in App.OnStart, which is what I primarily used it for.  I can use the OnVisible command which should work in most cases, but it will automatically reset any variables and there are some cases where I just need to set a variable once when I load and not every time I navigate to the home screen.  I have not found anything on how to effectively use the App.Formulas.  

 

@remariu 

The OnStart property of App still works for me right now, using formulas like Set(someVar,someValue), directly in the OnStart property of App, including in a brand new blank app made from scratch. I do not get any error of a contains Ident where PowerFXResolvedObject expected, or any error at all.

 

What is wrong with it for you?

 

Note than OnStart only triggers automatically in the live, published app.

To trigger it in the editor, click the ellipses to the right of App and then click Run OnStart.

poweractivate_0-1664872794178.png

 

Now click on Variables at the top, see if it worked

poweractivate_0-1665507127329.png

 

 

See if it helps @remariu 

remariu
Helper III
Helper III

Yes, I have to actively enable the App.OnStart feature in the settings and can use it, but I'm assuming this feature will be going away so I'm trying to find workarounds and how to deal with this in the future.  I can set a variable using App.Formulas and do not have any troubles with something I don't need to change within the app (i.e., varUserName = User().FullName). But, if I use this to set a variable such as varApprove = false, then I run into the error message later in the app (Unexpected Characters.  The formula contains "Ident" where "PowerFXResolvedObject" is expected) when I try to change the variable value.  So, in the short term, I will either continue to use App.OnStart or the OnVisible property of the home screen to set global variables.  I'm just not sure how to work around this when App.OnStart is no longer supported.

@remariu I didn't have to enable anything and it worked for me.

Are you referring to this Enable Navigate function in App.OnStart ?

 

poweractivate_0-1665507890008.png

 

If so, I recommend you try to turn it off, and then just use App.StartScreen to write the formula specifically and only for which Screen shows first when the App is started. When you do this, you write the formula like this for the StartScreen property of App

//App.StartScreen - pseudo formula example
SomeScreen

or for a more detailed example

//App.StartScreen - pseudo formula example
If
(
   someCondition1
  ,SomeScreen1
  ,If
  (
     someCondition2
    ,SomeScreen2
    ,If
    (
       someCondition3
      ,SomeScreen3
      ,SomeScreen4
    )
)

Other than the above, I am unsure what feature had to be enabled. You can use App.OnStart just like before without enabling the Retired feature above, if you don't currently use any Navigate call inside of it or don't deal with what Screen shows first anywhere in your App.OnStart currently.

 

remariu
Helper III
Helper III

First of all, thank you very much for all of your suggestions.  I feel like there is something basic that I am missing.  I used to use the Set(varXXX, YYY) at the App.OnStart, but without this function, I am trying to use App.Formulas and using varXXX = YYY.  I have not been successful in setting a variable using Set(varXXX, YYY) at App.StartScreen.  I have re-enabled the OnStart property at the Settings, General (see below) which allows me to continue to use the App.OnStart property, but I'm assuming this will be going away sometime in the future.

 

remariu_1-1665509227588.png

 

 

 

 

@remariu 

 

For me, this setting comes by default as On. If so , you must use App.OnStart.

 

You say you want to explicitly turn it off?

So if you turn it off, Save the app, and then refresh the browser.

 

However, I don't know if it is going away in the future, even if the new stuff is implemented at some point. Without App.OnStart, there's currently no way to put anything there OnStart, App.StartScreen just is a new way to tell you the StartScreen and nothing else, and you can use this with App.OnStart enabled or disabled. You need to just use OnVisible of the first screen instead then if you want to have no App.OnStart. 

 

If you really want to get rid of your App.OnStart property, what you can do is have a first screen, then leave this first screen blank, put a Timer control in this first Screen, duration 100 (or if it's too low, try 500), AutoStart true, and OnTimerEnd put all your formulas that set all the variables and then as the very last line, Navigate(someOtherScreen) away from it, and never return to this screen again elsewhere in your app. You can't use Navigate in an OnVisible of a Screen directly, it won't let you do that, so the Timer is necessary.

 

To test in editor, always click Navigate to StartScreen to do so. Note that Timers may not run in the Editor directly, and might only in the Preview of the Editor, so if you don't want to use Preview, you'll need to manually click the first Screen of your app (or manually click on Navigate to StartScreen)

poweractivate_0-1665510211169.png

(yes, I have no Run OnStart option in the above - this is intentionally missing, it's exactly how it looks when the setting you referred to is turned Off)

 

and then manually click the other screen the Timer goes to (say the second screen) each time you want to test your app from a clean run directly in the editor without explicitly or necessarily "previewing" it in the editor.

 

For StartScreen just set it to the first screen of the App (or maybe even leave it blank if it lets you do so, since the default might be just to load the first screen of the app anyway, but if you want, explicitly set App.StartScreen to the first screen of the App).

 

To my knowledge and awareness, there is no App.Formulas property, nor are any of the declarative approaches described in that blog post implemented as of yet, so the above might be the closest in order to really use the new features you are talking about.

 

See if it helps @remariu 

 

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,026)