cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
3csman
Impactful Individual
Impactful Individual

Issue with Flow Compose and JSON

I am trying to follow instructions from a site referenced to me about how to upload documents to an SP document library. I have tried eight times to get it to work, without success.

 

The issue is my inability to get passed the 'Compose' component of the flow creation.

This first image is my flow 'Compose', created EXACTLY as the instruction states. I am unable to see the inputs and outputs as displayed on the instruction 'Compose'. If I click on the download I get the entire file (blob, is it?) contents rather than the four lines shown in the instruction 'Compose'.

3csman_0-1613762695723.png

 

This is the 'Compose' from the instructions; where you can clearly see the inputs and outputs language that should appear. I have created the Collection per the instructions, and they have the required and appropriately named fields. Why am I not getting the same inputs and outputs as the example?

3csman_1-1613762750491.png

 

I've got the following in the Power Apps button:

3csman_0-1613763492828.png

 

 

24 REPLIES 24
3csman
Impactful Individual
Impactful Individual

Is this JUST for 'image' files? My build must accommodate image, excel, word, and pdf files. I need to be able to upload them and then see/open/link to each one on demand.

 

Please advise.

3csman
Impactful Individual
Impactful Individual

Should these be in the Power Apps button or in the Flow?

 

     Collect(colImagestoSharePoint,{FileName:AddMediaButton1.FileName, 

     Image:JSON(UploadedImage1.Image,IncludeBinaryData)})

     UploadMultipleImagestoSharePoint.Run("","","",JSON(colImagestoSharePoint,IncludeBinaryData))

3csman
Impactful Individual
Impactful Individual

I don't have dataUriToBinary in my Expression options.

 

3csman_0-1613775453699.png

 

3csman
Impactful Individual
Impactful Individual

Only one document (whatever type it is) at a time.

 

I'm hard coding because that is what the client wants. 

 

They have hundred of people uploading documents. They don't want hundreds of different file names/formats.

 

Hard coding the field names into the upload language will force the name to be a certain way no matter who is uploaded or what is being uploaded.

 

The issue I'm running into is viewing 'non-image' documents in a Power Apps Gallery. I can see the image files, I cannot see the other files types. I'm guessing it because of the hardcoding of filename and the addition of the default extension .jpg.

 

The hardcoding is a deal-breaker; got to have it. Any suggestions on how to correct this problem?

 

I have this in the button (connected to a flow).

3csman_0-1613779433618.png

 

3csman_1-1613779597125.png

 

If I use the following I can actually see the pdf file in the library but no thumbnail appears.

3csman_4-1613780017170.png

 

3csman_3-1613779977030.png

 

3csman
Impactful Individual
Impactful Individual

Finally made some progress. Now, how do I get the pdf to show, or at least link to it, from the Gallery?

 

Below is the library. The files are uploading to the proper library and I can see representations of the image and pdf files (Yay!).

 

3csman_0-1613783631508.png

 

This is the what's in the upload button - 

 

3csman_1-1613783818634.png

 

This is what's is the Flow - 

 

3csman_2-1613784101557.png

 

 

HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

Glad you managed to get the images/files in. Like I say do consider using the FileName property of the uploaded file, should you start to have issues predicting or working out what the file extension needs to be for each upload.


I would be tempted in a Gallery, just to use the LinktoItem property that should be available for a SharePoint Library. I would also think about coupling it with the Launch function and that way users will have something clickable and for a PDF, it should be fine to render in the browser.

3csman
Impactful Individual
Impactful Individual

I will try you recommendations.

 

I've was using the launch function previously, but it wasn't working on the pdf due to the link and the .jpg extention.

 

Maybe I missed it you your reply, do you have any suggestions about the file naming hardcoding? Is there any way to achieve that with multiple file types? I really need to be able to control how files are named.

3csman
Impactful Individual
Impactful Individual

Edit - This gets me the pdf to the library, put does not enforce the desired naming convention in the library or show a thumbnail of the pdf.

 

Set(varFileLink,
UpdateCertsorQualsFlow.Run(Last(UploadCQDocAttachment_2.Attachments).Name, varBase64Only).sharepointfilelink) 

 

I'm still struggling with this, even though I thought I had it beat. First image is the library. First item in the library is a newly uploaded pdf file. The condition was able to force the naming convention but I still can't see the thumbnail in the library or a representation of the file in the image control of the Gallery.

 

3csman_0-1613927481587.png

Here is the condition, that is successfully posting the document, but with a file extension that makes it viewable. If I put ".jpg" at the end where the quotes are (as I've been doing) I can see all image files but not pdfs.

 

Any recommendations on how to be able to write this condition so that it allows for viewing image and pdf files?

3csman_1-1613927538029.png

 

A generic file flow JSON command gets me the file to the library and recall to a Gallery but does not enforce the naming convention so there is no way to easily filter for the file by UserName, UnqID, etc., as required.

 

      " UpdatedQualificationFlow.Run(JSON(colUpdatedQualificationGallery,IncludeBinaryData)); "

 

HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

 

Yes, have mentioned it a couple of times previously but I will forgive you 🙂

Basically if you are using the add picture control, which I think you are in your Power App. There is a filename property. Now using that alone, will at least have the uploaded file name and extension.

Example: AddMediaButton1.FileName

So you could leave it as the above, or if you wanted to change the name. You could at least split out the extension from say the FileName property and then just prefix with a manually entered name.

This will then give you a situation where the extension is dynamically reflecting the file type uploaded. The only way this will fall short, is if someone gets clever and renames to an incorrect extension prior to uploading but in that case just fire them lol:)lol


3csman
Impactful Individual
Impactful Individual

How magnanimous of you.👍

 

So much back and forth that I couldn't find my way through; though I new there was something in there to find, an answer.

 

Now, to make sure I do this right can you please clarify:

 

You said:

 

"Basically if you are using the add picture control" - I am using an attachment control in a Gallery or Form (depending) to upload the files, and an 'Image' control in a Gallery to display the files from the library. There is no 'Add Picture' control being use anywhere. How does this change you recommendation?

You said:

 

AddMediaButton1.FileName - Will this still work in an attachment control? If yes, where exactly, are you recommending I place this; and what am I overwriting with it? 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (68,258)