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.
Solved! Go to Solution.
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?
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'
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
User | Count |
---|---|
182 | |
124 | |
88 | |
45 | |
43 |
User | Count |
---|---|
247 | |
156 | |
127 | |
78 | |
73 |