cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hansebs
Frequent Visitor

Unexpected token u in JSON at position 0 using forEach in web UI Flow

Hi all!

Since yesterday, my web UI Flows started to give me the error; "Unexpected token u in JSON at position 0" when using an input variable as the array in a forEach loop.

I'm in Europe (https://emea.flow.microsoft.com/).

Anyone else seeing this?

 

Steps to reproduce:

open | https://www.bing.com

forEach | values | value

echo | ${value}

end

When saving the above Selenium IDE code, I get the error.

 

Best regards,

Hans E

7 REPLIES 7
v-litu-msft
Community Support
Community Support

Hi @hansebs,

 

Could you please share an instance of array, is there any format error?

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi!

It doesn't matter what the array look like, because it's an input variable:

https://docs.microsoft.com/en-us/power-automate/ui-flows/inputs-outputs-web

The error comes when trying to save, not at runtime.

If I define an array in the code, it works just fine, but the problem seems to be when it's an input variable.

 

Best regards,

Hans E

@hansebs remove the echo value in foreach to solve!

hansebs
Frequent Visitor

Hi @pippo1!

Thanks for your input!

I forgot that echo is not supported in Power Automate!

However, even if I replace 'echo' with i.e. 'click', the error is sadly still the same. 

//Hans E

Did you manage to resolve this issue? I am unfortunately facing the same problem, but I can't seem to find a solution anywhere.

@hansebs 

After quite some time testing I figured out a solution, or at least a workaround, for this issue. Posting here in case others are still experiencing the same problem.

It appears that Power Automate requires that the Target and Value inside the for each Selenium activity is identical. The below image shows a configuration that works:

Svenny_0-1594423317987.png

If you try to set the value field to something else, e.g. the typical "itr" or "iterator", you will not be able to save the flow and the error occurs. See example of the configuration which will cause the error below:

Svenny_1-1594423527451.png

According to Selenium tutorials I have seen this configuration should be valid. Seems to be a bug.

 

jhowell-sfccc
Regular Visitor

I hope this bug gets fixed soon. Trying to work around it is becoming incredibly annoying.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,166)