Search code examples
powerapps

Powerapps, take photo and send it to other screen


I am building app with Powerapps that will be able to take a snap picture and the it to sharepoint, i all ready did this so far but i would like to, when i snap the photo not to have it on same screen where is live camera but have it on other screen, this why i can safe space on screen where am taking pic and having more space on other screen to work with taken pic, so is there command action for button that will take pic and move it same time to other screen?

My screens looks like this: Screen1 with button UpdateContext({TakenPic: Camera1.Stream}) Screen2 with Image source without command


Solution

  • When you use the UpdateContext function, it will create a context variable, which can only be used in the screen in which it was created - that's why you cannot use it in the second screen.

    There are a couple of alternatives you can use. You can use the third parameter of the Navigate function to create a context variable in the screen you're navigating to:

    Navigate(Screen2, ScreenTransition.Cover, { TakenPic: Camera1.Stream })
    

    And you can access the variable TakenPic on Screen2.

    Another option is to use the Set function to create a global variable - which can be used everywhere in the app:

    Set(TakenPic, Camera1.Stream);
    Navigate(Screen2)
    

    Hope this helps!