cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChrisCollao
Helper I
Helper I

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
v-bacao-msft
Community Support
Community Support

 

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
v-bacao-msft
Community Support
Community Support

 

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

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!

 

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.

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.

 

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.

@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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (3,026)