Attachment URL in Second Form

Labels

This Discussion is public

Notifications

Hello FF Community

I have tried searching high and low for information on this and can't seem to find anything. I'm hoping someone here will be able to help me.

I have Form B where I am using a Lookup field to pull values from Form A. Form A is completed by different users on the frontend.

One of the fields in Form A is a file upload field where users can upload an image.

The trouble I am having is retrieving the image URL of the uploaded image in Form A via the Lookup fields in Form B. Is there any way to do this?

Thanks in advance.

If you could explain what you are planning to do with the image URL in Form B, it will be easier for me to answer. Would you like to display the image in Form B or in a "View" of Form B? Either way, the Lookup field is not the right choice. Use the "Dynamic" field instead. Once I know your use-case, I can share more details.

Hi Sujeevan

Thank you for taking the time to reply.

I shall explain a little more in detail about what I am trying to achieve. The set up is a bit more complicated than what I initially explained.

Form B creates a post which admins use. It has a lookup field pulling information such as text fields, etc. from Form C (created by users on the frontend).

Form A is an image upload form posted by the same users on the frontend. Both Form A and Form C are tied to the user IDs. In Form A, after the user has submitted the form, the admin goes in to edit the form by adding an additional image to an image upload field (let's call this Field A). It is the URL from this image that I need to retrieve.

I am trying to create Form B which pulls information from both Form A and Form C (tied to the individual user ID). So I have set it up with one Lookup field pulling information from Form C (which works fine). For Form A, I need the lookup field in Form B to retrieve the image URL from Field A in Form A. This image then gets posted in a custom field when creating a post from Form B.

I though about and tried dynamic fields but it wouldn't work to pull information for a specific user ID (or would it - as I understand I can only use this for the current user).

I thought about creating the post directly on Form A (which is the image upload form). But even so, I have no idea how to get the image URL for the admin uploaded image in Field A.

I hope this isn't too confusing. I am at a total loss as to how to make this work and am resigned to the fact that I may have to manually enter the image URL in Form B when creating the post which isn't ideal as the image uploaded to Form A's Field A may change over time.

Hello,
Thank you for sharing more details. It is different than what I was thinking before. Anyway, the solution is straightforward.

1. Create a View for Form A with following settings
a) View Format: Single entry
b) Detail Page: [xxx] where xxx is the ID of the file upload field
c) Filter by "User ID" equals to [get param="my_user_id"]. If the same user is filling all the forms, User ID equals to current user will work. But form B is filled by Admin So "my_user_id" param is necessary.
d) Clear "No Entries Message"

2. Copy the View shortcode

3. In Form B, Create a text/hidden field and add above View shortcode as the default value. It will be something like below.

[display-frm-data id=33 filter=limited my_user_id=yyy]

Here we are passing a value yyy for "my_user_id" param. I hope you have a way to get the user ID of the user in Form B.

4. Now that you have a field with image URL, it can be mapped to the custom field in the post.

Hope this solves your issue. Wish you a Happy New Year.

Sujeevan

You are God-sent. :)

I managed to get the correct image retrieved per form using your instructions. Thank you so much!

The only issue remaining is that it is retreieving the image ID rather than the URL. I tried editing the shortcode in the view as such

[xxx show_filename=1] to test whether it would bring up the image name and it didn't.

I also tried

[frm-field-value field_id=xxx] but still only the image ID.

I have tried using the image ID as the custom field  but it doesn't populate the image. Would you know why it isn't displaying the URL?

Thank again for your help and time. :)

I wonder if it is because I had it set up to look up the value of the poster's user ID from a second lookup field in Form B.

So what I mean is in Form B that admins use to create the post, I had a lookup field setup to retrive the user ID from Form A. Then in the field where I had the view shortcode as the default value, I had the lookup field above selected to retrive the value of the user ID. Could this be the reason that it is showing the image id instead of the URL?

However, if I turn off the lookup value in this field, it doesn't display anything if I simply follow your instructions. How else would I retrieve the user ID from Form A?

Here are some screenshots as to how I have the form setup with 2 lookup fields.

Lookup Field 1: To pull information from Form C.
Lookup Field 2: To pull information from Form A image upload form which then displays the media ID.

Image 1

Image 2

Hi,
Sorry, couldn't reply on time. Were you able to find a solution? If not, please export your forms and share it here or email me (you can find it in my profile if you click on my name)

Reply to this Discussion