cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Attachment Control disabled

I have added an attachment control to my app, but it is not behaving as it should.  

 

I added an edit form from my list and chosen to only display the attachment field.   I have not changed any settings, so all are defaulted to 'Edit' mode.

 

When I preview the app, it is in view mode.   I have no earthly idea why this is happening.

 

EditAttachments.png

 

AttachmentsDataCard.png

DataCard9.pngPlayMode.png



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
13 REPLIES 13

Thank you, that worked.   This is the only form in my app.   I need to save the attachments in this form to the same items that is created when patching the remaining data to the SharePoint list but am not quite sure how to go about that.

 

Is it possible to do it all at once or will I need to get the ID of the newly created item and then save the attachments to it?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Hi @JR-BejeweledOne ,

 

Yes, try to modify the Patch code as follows, the ID value of new-created item is also saved to the Variable VarID when patching the remaining data to the SharePoint list

Set(VarID, Patch(...).ID)

Set the Form.Item property to LookUp('SP list', ID=VarID), then the attachment will be submitted to the just created item.

Hope this helps.

Sik

I am not sure I am doing this right.   I had set the Form.Item property based on your earlier answer and was then able to use the attachment control.

 

If I change Form.Item to the Lookup('Project Number Generator', ID=varID) as indicated, then I can't use the attachment control when live.   It goes back to the 'No Item to display'



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Hi @JR-BejeweledOne ,

 

That is because the record you are trying to edit on the Attachment Form has not been created, so the form shows 'No Item to display'.

 

Let's try this, first to submit the Form as a new record with attachment, and then Patch the remaining data to just-created record.

1. Set the Form Default Mode to New, add the required Column into the Form(i.e. Title), set the Default to anything to make sure the required Column is not blank. then set its Visible property to false

2. Set the Save button.OnSelect: 

SubmitForm(FormName);

 3. Set OnSuccess property of Form:

Patch('SP list',{ID: FormName.LastSubmitted.ID}, {.....})

 Hope this helps.

Sik

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (48,185)