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

Can Gallery Field Names be the Default File Name for Library Uploads

I finally got this to work (thanks to @HenryARPhillips ).

 

Clear(colUpdatedQualificationGallery);

ForAll(
       CertsandQualsLibraryGallery.AllItems,
       Collect(
             colUpdatedQualificationGallery,
             { Title: Name,
               DataStream: imgDataStream.Image
              }
       )
);
UpdatedQualificationFlow.Run(JSON(colUpdatedQualificationGallery,IncludeBinaryData) & "");

My next question; is there a way (either through the condition in the button or through the flow) to incorporate the below into the above so as to force the file to be named as shown in the below when it uploads to the library? It is imperative the file formatting below be the defa

Capture6.JPG

2 ACCEPTED SOLUTIONS

Accepted Solutions
HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

I would do something like this, so as to keep the file extension based on File Type.

 

HenryARPhillips_0-1614106846064.png

 

 

Then in your Flow just use the Title of the parsed JSON wherever you want.

View solution in original post

3csman
Impactful Individual
Impactful Individual

Close, but no cigar...

 

The need is NOT to default to a single name naming convention.

 

The need (more like desire) is to be able to use the Gallery fields and their content in the uploaded file naming convention through the condition or flow.

 

Example: If a member wants to upload a new Fitness Test, the file name they may have locally is 'Clark Kent fit test'.

 

This file name won't work for the library.

 

The condition I created will pick from all the data they are required to enter into the fields of the Gallery to form the file name in the library; 'Clark Kent fit test' becomes the following upon upload:

 

Naming Convention:   CQYr    UnqID       CQTitle      FirstNm     LastNm    DateofCQ

    Library File Name:    2021  CK0000   Fitness Test     Clark          Kent       2_2_2021

 

Each file must replicate this naming conversion based on the content of the fields names. My old condition does this; how can I edit your recommendation to also do this? 

For instance, will the following get me what I desire? It doesn't kick back an error? What about the pdf view issue?

 

ForAll(
CertsandQualsLibraryGallery.AllItems,
Collect(
colUpdatedQualificationGallery,
{
Title: UpdateStandardYearFld.Text & HiddenExistingCQDetailsGalleryUnqIDFld & UpdateCertQualTitleFld & HiddenExistingCQDetailsGalleryFirstNameFld & HiddenExistingCQDetailsGalleryLastNameFld & UpdateDateofCQFld.SelectedDate,
DataStream: imgDataStream.Image
}
)
);

View solution in original post

8 REPLIES 8
HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

I would do something like this, so as to keep the file extension based on File Type.

 

HenryARPhillips_0-1614106846064.png

 

 

Then in your Flow just use the Title of the parsed JSON wherever you want.

View solution in original post

3csman
Impactful Individual
Impactful Individual

Close, but no cigar...

 

The need is NOT to default to a single name naming convention.

 

The need (more like desire) is to be able to use the Gallery fields and their content in the uploaded file naming convention through the condition or flow.

 

Example: If a member wants to upload a new Fitness Test, the file name they may have locally is 'Clark Kent fit test'.

 

This file name won't work for the library.

 

The condition I created will pick from all the data they are required to enter into the fields of the Gallery to form the file name in the library; 'Clark Kent fit test' becomes the following upon upload:

 

Naming Convention:   CQYr    UnqID       CQTitle      FirstNm     LastNm    DateofCQ

    Library File Name:    2021  CK0000   Fitness Test     Clark          Kent       2_2_2021

 

Each file must replicate this naming conversion based on the content of the fields names. My old condition does this; how can I edit your recommendation to also do this? 

For instance, will the following get me what I desire? It doesn't kick back an error? What about the pdf view issue?

 

ForAll(
CertsandQualsLibraryGallery.AllItems,
Collect(
colUpdatedQualificationGallery,
{
Title: UpdateStandardYearFld.Text & HiddenExistingCQDetailsGalleryUnqIDFld & UpdateCertQualTitleFld & HiddenExistingCQDetailsGalleryFirstNameFld & HiddenExistingCQDetailsGalleryLastNameFld & UpdateDateofCQFld.SelectedDate,
DataStream: imgDataStream.Image
}
)
);

View solution in original post

3csman
Impactful Individual
Impactful Individual

All works great, except I still can't see the thumbnail. But, the doc is there because the Launch( function is opening the pdf in web view.

 

Any other thoughts about the preview/thumbnail view of the pdf files (this is the only file to which this is happening).

HenryARPhillips
Continued Contributor
Continued Contributor

Are you using the PDF Viewer control and it is not working as suggested or just the image control still? I would try making use of the PDF Viewer control, that should definitely work for PDFs

3csman
Impactful Individual
Impactful Individual

I agree. Thought about using the pdf viewer control.

 

Alas, I couldn't determine what to put in the 'Document' property of the pdf viewer control to pull the correct document every time the name of the CQTitle changes in the Gallery.

 

I tried to just toss what was in the Image control 'image' property, that didn't work.

HenryARPhillips
Continued Contributor
Continued Contributor

Mmmmm, that should work. I had: Gallery2.Selected.Value

 

So where Gallery2 will be the name of the Gallery you are using to preview items in the Attachments control.

With the above, you will need to ensure that the PDF entry is selected within the gallery.

If this is being done against an already upload entry and link to item is available, then Gallery2.Selected.Link to Item would probably work too.

3csman
Impactful Individual
Impactful Individual

Is see the confusion.

 

I am not trying to view what is in the attachment control. I am trying to view what has already been uploaded to the library.

 

The Gallery in question is a review Gallery; it provides the User with a look at all their Certs and Quals that have already been uploaded. For instance, the below is the Gallery. Let's assume for this example the document is an image file that was uploaded to the library, the user would see a preview of that image/file, and if they clicked on the image a full web page version of the document opens.

 

If the User were to use the navigation button to transition through all the documents they have currently all images would show in the image control. However, if the document was uploaded as a pdf file the image control would appear blank even though its not, because if the user clicks on the 'blank' control pdf opens in full web view mode. So, the Gallery and image control knows something is there and will open it in web view, the user just can't see the thumbnail in the image control, because its formatted as pdf.

 

How do I get both image files and pdf files to appear in the image control based on the item chose in the Gallery?

 

3csman_0-1614122785542.png

 

3csman
Impactful Individual
Impactful Individual

 You state

 

So where Gallery2 will be the name of the Gallery you are using to preview items in the Attachments control.

 

I'm not trying to preview what's in the attachment. I'm trying to recall what has already been uploaded to the SP Library. The Gallery Image Control knows there is a document (because the 'No Record Found' icon DOES NOT appear); however, no image appears, either. Yet, I the user clicks the box the pdf files DOES open in a web page view. When the item an image a picture appears in the image control. When the item is a pdf NO image appears in the image control; however, clicking the image control does open the web version for both file types. 

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.

Top Solution Authors
Top Kudoed Authors
Users online (44,949)