How to pick an image / take photo and store it to pageVariable?

I want to add a photo from the take photo or pick image from library flow function to an pageVariable to temporarely show it on the page before uploading it to database. (I’m creating a website)
I did everything said in the youtubevideo to show the image in app. But i get error messages, unless i did everything exact like there.


Opera Momentaufnahme_2020-11-19_155148_platform.appgyver.com

what is pageVars.image ? an object or just text variable?

Any way you need to get the path from the output like this:
outputs[“Take photo”].photoFile.path

It’s the second image…
List of objects with 1 property (the same thing as in the video)

I tried yours

the .path property is what the image component needs to display the image, so you need to set your image component source = outputs[“Take photo”].photoFile.path

I need to firstly store it to an variable. But this does not work. I get the in image shown error.

I can’t set the the image component source to outputs[“Take photo”].photoFile.path because it’s an other component than the button which one i use to upload the image.

Hello!

It’s amazing Tutorial from Mevi. Thanks a lot!

But help save to library of my ios device prewiew image.

Help me ASAP!

Hi! I don’t think we have a tutorial about this at the moment, but I think the correct way is to save it under systemVars.fileSystem.directories.document. Please note that you need to use the dynamic path given by the formula (see why here).

@apstore what I do here:
After the “Take photo”, I move the image from the temp storage to the document storage with the “Move/rename file/directory” flow function and the following formula: systemVars.fileSystem.directories.document + “/” + custom filename

Then I put the same formula into the image binding. Please note that you need to add “file://” in front here as the image will not be found on Android otherwise by the image component!

1 Like

Thanks.
Can you add copy screens of this manipulations?

unfortunately my logic around it is so complex that it would not help you much… (I also have the photo editor in between,…)
If you run into issues, please let us know where you got stuck!

Stuck at this stage - photo is created and saved to a variable. Now you need to save to your phone.

Снимок экрана 2021-02-24 в 13.13.02

How did you built up your image repeat function?
The path for the image is under photoFile.path

It’s great question. I don’t know how, and next steps in stupor.

@apstore this is how you will need to modify the logic, either you do this at the Take Photo stage or from a separate “save images” button.

Thanks, but this formula is not corrector I don’t know what need to add else

For example: systemVars.fileSystem.directories.document + “/” + apimiage.jpg

Print Error in formula

well, the filename needs to be also a string, that is, with " surrounding it, unless you get it dynamically from somewhere.

Thanks Mevi! In formula was mistake, but miracle is not it :frowning:

I add screens all my installations, please say - where is my mistake, and how correct it.

Thanks

Снимок экрана 2021-03-03 в 09.30.54

Well, I think this might be it: the source file path should be the path you get from the Take Photo flow function.

Good evening, tell me the following details: 1. Where should the photo be saved on the iPhone? 2. Is the specified flow function “move file” is above for the correct saving of photos in the photo album?

Hi! Sorry for my late answer.

  1. target file path: systemVars.fileSystem.directories.document + the name of the file, as in your screenshot, source file path: take photo’s path
  2. Move file is correct