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

JSON Parse failing on optional attachement Form

Hi everyone,

 

Few days ago, I submitted a topic about how to populate a Word Template with different images coming from a Form (here is the topic: https://powerusers.microsoft.com/t5/Building-Flows/Populate-Word-Template-with-Multiple-Images-submi... ).

That issue got solved, but now, a JSON Parse step is failing if there's no file uploaded at some of the questions (because they were optional on the Form).

Is there a way that I can let the question without the 'Required' mark, so people are able to not upload an image, and JSON Parse doesn't fail?

 

Flow.PNG

 

Details: 

- The form has 3 questions where submitters can upload 1 image on each (optional).

- The flow has 3 JSON Parse that will get those image to let them able to use in a Word Template.

- The flow fails if one of the 3 questions doesn't have a file uploaded.

 

Thank you so much for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: JSON Parse failing on optional attachement Form

 

Hi @ChrisCollao ,

 

Please check the following configuration, you could use Condition to check if the attachment is empty:

146.PNG

 

Best Regards,

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

View solution in original post

6 REPLIES 6
Highlighted
Community Support
Community Support

Re: JSON Parse failing on optional attachement Form

 

Hi @ChrisCollao ,

 

Please check the following configuration, you could use Condition to check if the attachment is empty:

146.PNG

 

Best Regards,

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

View solution in original post

Highlighted
Frequent Visitor

Re: JSON Parse failing on optional attachement Form

Hi @v-bacao-msft , thanks for the response.

 

One question with this solution: ¿Is it possible to leave the "If No" section empty and keep up with the Flow with next steps apart?

 

Thanks!

Highlighted
Community Support
Community Support

Re: JSON Parse failing on optional attachement Form

 

Hi @ChrisCollao ,

 

Yes, you only need to configure all actions in the If yes branch.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: JSON Parse failing on optional attachement Form

Hi @v-bacao-msft 

 

Finally created the flow with the If conditions, but got an error at the step "Populate Word Template". 

 

Flow2.PNG

 

If the word step waits an image as input, but it doesn't exist, is there anyway to solve it? (a better way than creating 'n' word templates to set them on the multiple possibilities).

 

Thank you so much.

Highlighted
Community Support
Community Support

Re: JSON Parse failing on optional attachement Form

 

Hi @ChrisCollao ,

 

You could append the file content to an array and get the elements in the array by index.

Then you can configure each item in the control corresponding to Work template.

151.PNG152.PNG153.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: JSON Parse failing on optional attachement Form

@v-bacao-msft thanks for your help.

 

I will accept the first post as a solution for the first issue, but I think that I may open a new one to the Word's issue. Maybe I didn't explained clearly enough.

 

Thanks a lot.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (4,884)