cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChrisCollao
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
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
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (35,576)