Skip to main content
added 632 characters in body
Source Link
Dylan Cristy
  • 12.8k
  • 3
  • 32
  • 72

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. :)

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.

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. :)

added example code
Source Link
Dylan Cristy
  • 12.8k
  • 3
  • 32
  • 72

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.

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

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.

Source Link
Dylan Cristy
  • 12.8k
  • 3
  • 32
  • 72

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