cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SamTimmins
Regular Visitor

Site Inspector Template - Saving images to network folder

Hi All,

 

Does anyone have experience with the Site Inspector template app, and saving the images from there into a network folder location?

 

We've setup flow buttons that do something similar (take a photo on the phone, upload to a network folder) however not sure how to integrate that into the app itself. 

 

Possibly a way to integrate a flow command onto the 'Save' button from 'NewInspectionScreen'

 

Any ideas appreciated.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @SamTimmins ,

Could you please share a bit more about your scenario?

Do you want to save images collection from your canvas app to your Network folder location?

 

 

Based on the needs that you mentioned, I afraid that there is no direct way to achieve your needs in PowerApps currently. As an alternative solution, I think the combination of PowerApps and Power Automate could achieve your needs.

 

On your side, you could consider pass the images collection back to your flow, then within your flow, add a "Create file" action of "File System" action, use it to create image file in your Network folder based on the passed image data.

 

I have made a test on my side, please consider take a try with the following workaround:

Within your "Site Inspector" template app, go to the Camera screen, modify the formula within the OnSelect property of the Camera control to following:

If(
   CountRows(CameraPhotos) <=7 ,
   Collect(
             CameraPhotos, 
             {
               Note: "", 
               Photo: Substitute(JSON(camera1.Photo,JSONFormat.IncludeBinaryData),"""",""),   // Modify formula here
               PhotoId: CountRows(CameraPhotos)
             }
   )
)

 

Flow's configuration:

1.JPG

Within the "Create file" action of File System connector, File name field set to following:

concat(item()?['PhotoId'], '.jpg')

File content field set to following:

dataUriToBinary(item()?['Photo'])

 

Then within your "Site Inspector" template app, go to the NewInspectionScreen, add the following formula within the OnSelect property of the "Done" button:

2.JPG

SaveImageCollectionstoLocalNetworkFolder.Run(JSON(CameraPhotos))

 

More details about firing a flow from an app, please check the following video or article:

https://www.youtube.com/watch?v=1wl9AtxWdkg

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

 

Best regards,

Community Support Team _ Kris Dai
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

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @SamTimmins ,

I had a quick look.

Firstly, camera1 on the CameraScreen is the same type of control and the OnSelect runs

If(
    CountRows(CameraPhotos) <= 7,
    Collect(
        CameraPhotos,
        {
            Note: "",
            Photo: camera1.Photo,
            PhotoId: Max(
                CameraPhotos,
                PhotoId
            ) + 1
        }
    )
)

which sends the photo off to a collection called CameraPhotos - very similar to the colPhoto in the example I posted for you.

The data sources in the example are off on your private storage (it sent mine to my G Drive as I was logged in on Chrome).

So after you add your SharePoint Library, you should be able to do something similar for CameraPhotos as you have for colPhoto

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

v-xida-msft
Community Support
Community Support

Hi @SamTimmins ,

Could you please share a bit more about your scenario?

Do you want to save images collection from your canvas app to your Network folder location?

 

 

Based on the needs that you mentioned, I afraid that there is no direct way to achieve your needs in PowerApps currently. As an alternative solution, I think the combination of PowerApps and Power Automate could achieve your needs.

 

On your side, you could consider pass the images collection back to your flow, then within your flow, add a "Create file" action of "File System" action, use it to create image file in your Network folder based on the passed image data.

 

I have made a test on my side, please consider take a try with the following workaround:

Within your "Site Inspector" template app, go to the Camera screen, modify the formula within the OnSelect property of the Camera control to following:

If(
   CountRows(CameraPhotos) <=7 ,
   Collect(
             CameraPhotos, 
             {
               Note: "", 
               Photo: Substitute(JSON(camera1.Photo,JSONFormat.IncludeBinaryData),"""",""),   // Modify formula here
               PhotoId: CountRows(CameraPhotos)
             }
   )
)

 

Flow's configuration:

1.JPG

Within the "Create file" action of File System connector, File name field set to following:

concat(item()?['PhotoId'], '.jpg')

File content field set to following:

dataUriToBinary(item()?['Photo'])

 

Then within your "Site Inspector" template app, go to the NewInspectionScreen, add the following formula within the OnSelect property of the "Done" button:

2.JPG

SaveImageCollectionstoLocalNetworkFolder.Run(JSON(CameraPhotos))

 

More details about firing a flow from an app, please check the following video or article:

https://www.youtube.com/watch?v=1wl9AtxWdkg

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,221)