Pick image from library function problems

I cannot seem to get the pick images from library file path to the app variable using the formula outputs[“Pick image from library”].imageFile.path

Are there any internal problems here?

To get some additional details, would you be able to connect an Alert flow function to the “Pick Image from Library” Output Port 1 and another alert flow function to the Output Port 3.

Select the “Output from another node” as the data to display in the Alerts.

Save this and then run the app from the AppGyver emulator and after selecting an image, see what data is displayed. Share that info here and I will see if we can get you up and going!

Thanks.

1 Like

/storage/emulated/0/Download/

followed by a long string of alphanumeric characters

That is the raw data message.
The error message is “Unkown”.

I also attached an alert flow function on output 3, and app variable to output 1. Each time I uploaded photo I received an error message. When attaching an alert to both outputs, I receive the raw data as storage/emulated/0/Download/followed by a bunch of characters.

Based on the image path you shared, I am guessing you are using an Android device. I am an iPhone user so my image path looks different (attached screenshot below for reference)

It would seem that you have an image path and filename from your “Pick image from library” flow function. I might be misunderstanding your post (re-read it :slight_smile: ). Is it your app variable that doesn’t have the image path/name?

I am not sure if the app variable is not accepting the path, or if the pick image from library is not able to transfer the path. When I place the alert on the third output of pick image from library, it fails. So the app variable is unable to get the path for some reason. I tried both image URL and and Path File System. I tried formula’s, no formula’s, still doesn’t want to accept the file path.

To make sure we are working from the same general flow function setup (I am assuming you were working with my video (Part 10), I am attaching a screenshot of how my screen and flow functions are setup…

Yes. Exactly the same. I was following your video. Step by step.

I also tried to change the variable type. For example, I started with imageUrl as you have in the video; however, when outputs[“Pick image from library”].imageFile.path didn’t work, I switched the app variable type to local file systems path, because that doesn’t require a formula. Unfortunately , that did not work either. Perhaps there is a problem with the flow function on android devices? I wonder how to work around this.

Can you try using “text” instead of image URL or Path File System using a Formula? I have had issues (iPhone) with matching image and URL “paths” with the specific variable types (URL, Path File System). Sometimes I have better luck using a formula and a simple text variable.

Sorry to ask you to try so many different things, I am trying to get a feel for what the problem is doing a version of “remote” debugging via your efforts :slight_smile:

I have already tried path, but I can try text. Let me see how that goes.

Yeah it doesn’t like text either :frowning:

We might have to look to the wisdom of @Mevi (or other AppGyver members) to help us see what we are missing.

I have the feeling that I am missing an obvious minor point and without access to your project I can’t easily work through it. I am hoping that the AppGyver team with the use of your project id can see what I am missing.

Okay. I really do appreciate your effort and help in this matter. So thank you for that.

1 Like

I am happy to keep working on a few more obscure options, but I don’t want to make you be my fingers on the keyboard via continued replies :slight_smile:

1 Like

If you are interested, you could use the default AppGyver image path (pasted below) as the static value to set to your app variable (instead of using the Pick Library - Output 1 - Imagefile.path). This would confirm that the app variable can be set with a valid, known image path.

It would also allow you to confirm that the rest of the flow functions work in this setup.
https://s3.amazonaws.com/appgyver.assets/composer3/images/image_placeholder.png

I am able to set the app variable with that static path, and other similar static paths, but unable to get the path from output 1. ID 176050 if anyone wants to take a look.

Since it is a new morning, I am going to offer up another item to check.

In the screenshot below, you can see that the “Assigned value” field that was set in the Forumula has a unique id for the “Pick image from library” component (outputs[“19f07237.d2c2ae”].imageFi…). If that id doesn’t match the id of the “Pick image from library” component you will have “weird” issues.

The easiest way to see if this might be the underlying issue is to delete the “Pick image from library” component, then add it back to the canvas and then go into the “Set app variable” component and redo the “Assigned value” Formula by reselecting the “Output of another node” value in the Formula editor and the imageFile.path value.

I’ve tried that as well. Have you tried acquiring the path from pick images from library flow function and setting the app variable on Android devices? If you try the same process on android, I’m almost certain that you will have the same error. I’ve tried a number of different variable types and formula’s, but it doesn’t want to take the path.

I will need to hunt down an android device. I’ll give it a try as soon as I have have found one. It will be a good thing for me to have for my testing anyway :slight_smile:

1 Like