cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mithushalk
Helper V
Helper V

Error using Join (Json)

Hi team, 

My flow was working fine but suddenly started throwing an error 

Error - Unable to process template language expressions in action 'Join' inputs at line '0' and column '0': 'The template language function 'json' parameter is not valid. The provided value 'XYZ' cannot be parsed: 'Unexpected character encountered while parsing value: P. Path '', line 0, position 0.'. Please see https://aka.ms/logicexpressions#json for usage details.'.

 

mithushalk_0-1642597931104.png

 

7 REPLIES 7
MarvinBangert
Super User
Super User

Hey @mithushalk 

what is the input into your join? Probably there is some information that is not a valid character like quotes etc. To troubleshoot, you can add compose before your Join and add the dynamic value you are trying to join into this compose. Run this flow again using "Test - From previous run" and select the failed flow. Within your compose you should see the exact output what is given into the join. Then there is maybe something like a single quote, a double quote, etc. thats causing your error.

Consider to prevent users adding this time of special characters into your flow or try to remove them before you join them.

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

mithushalk
Helper V
Helper V

Hi @MarvinBangert 

I have a name coming into the flow from a form response.

 

I did the same as instructed but still throws the same error.

mithushalk_1-1642600119711.png

 

mithushalk_0-1642600403778.png

Code i used - 

json(outputs('Project_Collect_Response')?['body/r67a3fffc2cbc409ba7a90d05c1125f0c'])


Can you please show me a demo if possible? That will be more helpful.

MarvinBangert
Super User
Super User

Hey @mithushalk 

could you please also show me the actions in your flow before this error occurs, so that I see the whole process what you are doing? If you are using the output from a MS Form, could you please check within your "Get response details" action what is written within the field you are trying to join? Otherwise please only add outputs('Project_Collect_Response')?['body/r67a3fffc2cbc409ba7a90d05c1125f0c'] as an expression to the compose and check this again.

I will later check later if I can build a demo, but this will probably take a couple more hours to wait.

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

@MarvinBangert 

As suggested, I tested the flow with Compose & input-output has the same value.

 

mithushalk_0-1642604760141.png

 

MarvinBangert
Super User
Super User

Hey @mithushalk 

I could rebuild the same problems within my Lab, but I need a bit more details about the process overall to better understand what you are trying to achieve. What is the overall task of this process? Someone is filling out an MS Forms form, one question is a text input, where someone puts in something like "Products: X Y".

I am a bit confused that it worked before using the json, because "Products: X Y" isn't in the right format to get formatted (thats what the error says), it needs to be a string in a format like ["Product: X Y"] or ["Product: X Y", "Product: A B"] to get parsed using the "json()" function.

 

Thanks for your patience, but I am not sure about the overall task this flow parts needs to take and cannot figure out what the best solution would be. Maybe you have an old flow run, where the input passes the "Join" action?

Like as an example: What is the possible input from your MS Form and what is the output you need to work with this information?


Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

@MarvinBangert 

Process plan - The user would fill in the form by choosing the project approver from the list given in the MS forms.
I have created a repository of project approvers email addresses on SharePoint. So, when the user picks the name flow has to pick the email address beside the name & send a project approval request to the relevant person.

 

 

MarvinBangert
Super User
Super User

Hey @mithushalk 

I am very sorry for the delay and thanks for your explanation, that actually helped me!

From your image: https://powerusers.microsoft.com/t5/image/serverpage/image-id/401129i749D7C150E840986/image-size/med...

you can see that the output directly from MS Forms is:

Product: X Y

From a Choice Field in MS Forms, you can get 2 outputs, if the Choice only allows single choice, you receive:

Product: X Y

If you allow multiple Select, your output would look like:

["Product: X Y"]

or multiple values:
["Product: X Y","Product: A B"]

Using the multiple choice wouldn't occurs the error within your flow. If you change the MS Forms setting to "Single choice", the flow cannot handy the syntax anymore and you wouldn't need the "json()", "JOIN" and split anymore to lookup the values from SharePoint, you could directly lookup the value from SharePoint.

 

So depending on your plan, you could change it back to "Multiple choice" in MS Forms or if you only want "Single choice", you need to change your flow by removing the extra actions, you don't need anymore.

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

Helpful resources

Announcements
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.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,295)