1

I have a work order app.

There is a main work order and a secondary work order (two separate screens).

The base data (names, places, contact info), is the same for both.

The primary inspection may lead to findings that require a second and associated inspection, which is entered on the secondary work order screen.

I've got a Patch uploading all of the data from both forms, including the attachments (images taken by a camera control on form 1). There is also a camera control on the secondary work order screen.

Is there a way to create a separate/second 'Attachment' column in the SharePoint for the secondary images taken? I can't find 'Attachments' as an option in the 'Create Column' of the SharePoint list setup.

How do I upload the secondary attachments/images and associated them with the secondary work and not the primary work?  

2 Answers 2

0

By default SharePoint lists support only one attachments column and you cannot add new attachments column in a SharePoint Online list.


SharePoint Online lists supports image column types, read all you need to know about New Image column type in SharePoint Online.

Unfortunately, this column type supports adding single image per column. So, if you are capturing only one image in primary/secondary form, you can use image column in list.

Also, as per Power Apps can now display images from SharePoint Online/Microsoft Lists, currently image columns only support "Read/display" operations in Power apps.

So, you have to first upload the image to any document library/Site Assets library and then update image column using REST APIs (using Power automate flow).

You have to set the image field in this format:

Image: {
    'fileName':'Power Apps logo.jpg',
    'serverRelativeUrl':'/sites/MySite/SiteAssets/Lists/dbc6f551-252b-462f-8002-c8f88d0d12d5/Power%20Apps%20logo.jpg'
}

If you want to add multiple files/images, you have to use the document library & connect it with the list.

Two ways:

  1. Create lookup from SharePoint list to document library & add files in library.

  2. Create a folder in library with unique column value from list (maybe list item ID) & add files to that folder.

Additionally you can provide the hyperlink to that library/folder in your list either manually using hyperlink column Or using JSON Formatting. So that users can easily navigate to library from the list view in SharePoint.

Similar thread: Add another attachments column to sharepoint list

0

I have never heard of adding a second Attachments column, and I don't think you can.

I would suggest using a naming convention to either prefix or suffix the file names so you can tell which work order they belong to.

Something like

1_some file name.jpg
1_some other file.jpg
2_second work order file.jpg
2_another file.jpg

or

some file name_1.jpg
some other file_1.jpg
second work order file_2.jpg
another file_2.jpg

After seeing your code you posted in your comment, what I'm suggesting would be to edit what you have there, but do some string concatenation to put a prefix on the file name. It could either be in the Set or in the Collect, the way you have it there. You could either do

Set(varJobImage, "1_" & GUID());

and leave the Collect as is, or leave the Set as is and change the Collect to be

Collect(
    NewReportVehicleImageCollection,
    {
        DisplayName: "1_" & varJobImage & ".jpg",
        Id: "1_" & varJobImage & ".jpg",
        Value: Camera1.Photo
    }
);

Then you'll know any attachments that start with "1_" are for the main work order.

Do the same with "2_" for the secondary work order.

Actually, I found this article that talks about different ways to concatenate strings in Power Apps, and given that using the $ string interpolation syntax is possible, I think it would make your code much easier to read if you used that, and moved all of the string concatenation into the Set, and not do any of it in the Collect:

Set(varJobImage, $"1_{GUID()}.jpg");
Collect(
    NewReportVehicleImageCollection,
    {
        DisplayName: varJobImage,
        Id: varJobImage,
        Value: Camera1.Photo
    }
);

Nice and clean and easy to see what's going on. :)

2
  • My main camera control has the following in the OnSelect, that creates a collection that I reference in the Gallery on screen for review before Patching. Are you suggesting editing the below, or creating another with different names, to solve my problem? Set( varJobImage, GUID() ); Collect( NewReportVehicleImageCollection, { DisplayName: varJobImage & ".jpg", Id: varJobImage & ".jpg", Value: Camera1.Photo } ); Jun 6, 2022 at 16:35
  • @CurtisETroutt updated my answer with an example Jun 6, 2022 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.