
I have a screen , where the user enter an ID + Attach an image >> now i want to get the item which have the related ID >> and get the attachment content >> then add the attachment as attachment inside the list item?
Can anyone advice?
Here is what i did, where i added an Input text to enter the ID + Add Picture media:-
and the following formulas inside the button:-
// Get the entered ID
Set(
enteredID,
TextInput1.Text
);
Set(
selectedItem,
LookUp(test1231, ID = Value(enteredID))
)
;
// Check if a list item is found
Patch(
test1231,selectedItem,
{
Title:selectedItem.Title,
Attachments: UploadedImage2
}
);
but when i click on the button >> no attachment will get added to the list item
Hi!
You can't patch attachments that way. You can either patch using FormName.Updates or by creating a form that you submit.
I would use a Power Apps Form - make the Item property
LookUp(test1231, ID = Value(TextInput1.Text))
Then only include the Attachments field (and any required fields - you can hide these after confirming they will be keeping the existing value).
That way you can use the SubmitForm() function and the form will handle adding the attachments to the row item.
Cheers,
Sancho