cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Unexpected Token Error

Hi,

 

 

I am encountering an error 'unexpected token' when trying to run my PowerApp on the phone/tablet/web. It works fine in PowerApp Studio.

 

The error is on each of the three screens (browse, Detail, Edit). E.g. the function behind the '+' button for adding new records looks like this when opened in the web designer:

 

NewForm(EditForm1),,Navigate(EditScreen1, ScreenTransition.None)

The 'unexpected token' error is related to the comma (',') after ...(EditForm1).

 

Oddly, when opening the same App in Sudio, the same function looks like this:

NewForm(EditForm1);;Navigate(EditScreen1; ScreenTransition.None)

Here is what I did to create the App:

  1. Create a custom list in SharePoint online
  2. Click 'PowerApps', 'Create App' from the menu
  3. Edit the App in Studio
  4. Save and publish App

 

I suspected a problem with my regional settings, where I have semicolon (';') defined as list separator, which seems to be considered in Studio but not in the Web Designer. Changing this to comma (',') did not help.

 

So I am a bit at a loss as how to proceed, without losing the work I already put in. Any ideas?

 

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Regular Visitor

Re: Unexpected Token Error

Based on @Drrickryp's input I played around a bit more. Turns out that the solution seems to be to edit the PowerApp in Web Designer and replace the two commas ',,' with a single semicolon ';'.

 

So we go from this:

NewForm(EditForm1),,Navigate(EditScreen1, ScreenTransition.None)

To this:

NewForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None)

I want to emphasize, that the code with two commas is the one automatically generated by PowerApps Designer, when I created the App based on a SharePoint list. I can only conclude that their is something fishy.

 

However, this fix seems to work and hopefully helps others.

 

 

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Unexpected Token Error

You only need one semicolon. Take out the second one
Highlighted
Regular Visitor

Re: Unexpected Token Error

Thank you for the swift reply. Alas, also with a single comma, the problem remains the same:

 

unexpected token.jpg

 

Highlighted
Regular Visitor

Re: Unexpected Token Error

Based on @Drrickryp's input I played around a bit more. Turns out that the solution seems to be to edit the PowerApp in Web Designer and replace the two commas ',,' with a single semicolon ';'.

 

So we go from this:

NewForm(EditForm1),,Navigate(EditScreen1, ScreenTransition.None)

To this:

NewForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None)

I want to emphasize, that the code with two commas is the one automatically generated by PowerApps Designer, when I created the App based on a SharePoint list. I can only conclude that their is something fishy.

 

However, this fix seems to work and hopefully helps others.

 

 

View solution in original post

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,345)