Hi All,
I have a form where there are is an attachment column which needs to attach files from PowerApps to SharePoint list using Patch function. I am using Patch function for the form because I have two choice fields which is of Multi-select column type. I have two for ne for Edit and New form. The Patch function which I have given is :
If(
IsBlank(DataCardValue1_2.Text) || IsBlank(DataCardValue5_2.SelectedItems) || IsBlank(DataCardValue2_2.Text) || IsBlank(DataCardValue3_2.Text) || IsBlank(DataCardValue4_2.Text) || IsBlank(DataCardValue11_2.Selected) || IsBlank(DataCardValue16_2.SelectedItems) || IsBlank(DataCardValue17_2.SelectedItems) || IsBlank(DataCardValue18_2.Selected) || IsBlank(DataCardValue19_2.Selected) || IsBlank(DataCardValue10_2.Text),
UpdateContext({varblank: true}),
If Error(
Patch(
VictoryStrokes_List,
Defaults(VictoryStrokes_List),
{
'Case Title': DataCardValue1_2.Text,
'Case Study Value Focus': DataCardValue5_2.SelectedItems,
'Competencies involved': DataCardValue17_2.SelectedItems,
'Customer Name': DataCardValue11_2.Selected,
'Business Challenge or Need': DataCardValue2_2.Text,
Solution: DataCardValue3_2.Text,
'Business Benefit': DataCardValue4_2.Text,
'Customer Testimonial': DataCardValue6_2.Text,
'Profit Line': DataCardValue20_2.Selected,
'Contributing Team members': DataCardValue16_2.SelectedItems,
'Primary Engagement work': DataCardValue18_2.Selected,
'Technologies involved': DataCardValue10_2.Text,
'Engagement Start Date': DataCardValue13_2.SelectedDate,
'Engagement End Date': DataCardValue14_2.SelectedDate,
'Company Engagement': DataCardValue15_2.Selected,
'Delivery Model': DataCardValue9_2.Selected,
'Engagement Deal Size': DataCardValue22_2.Selected,
Geo: DataCardValue8_2.Selected,
'Industry Vertical': DataCardValue7_2.Selected,
'Project Delivering Company': DataCardValue19_2.Selected
},
Form1_2.Updates
),
Notify(
"Details needed",
NotificationType.Error,
1000
),
Notify(
"submitted successfully",
NotificationType.Infomation
1000
),
ResetForm(Form1_2);
Notify(
"Case Details submitted successfully",
NotificationType.Information,
1000
) && Navigate('Gallery Details')
)
)
Without giving attachments it is saving fine. but if I give Form1_2.Updates to save attachments it is giving the error notification which I given above.
Any help or suggestion on this would be greatly appreciated.
Thanks in advance.
I have attached screenshot of the error
Hi,
Happy to help!!
There are a few issues I see. Also, could you 🙂 please use the </> when posting code. It makes it so much easier for me to copy out and fix straight away :-).
These changes will help us identify the issue (including the Error message and extended details)
Bug:
1. In the code you have the following code
Notify("submitted successfully", NotificationType.Infomation 1000),
But there is no comma between the Information and 1000
Asks:
1. Can you please change your Error Notification to actually be this.
//change this
Notify(
"Details needed",
NotificationType.Error,
1000
)
// to
Trace("Error: " & FirstError.Message);
Also, please change your Success to
// This is where the bug is too, but please change this
Notify("submitted successfully", NotificationType.Infomation 1000),
// To this
Trace("Submitted Successfully");
Ok, now please do the following steps. This will help us
Step 1. Close your App (stop it running)
Step 2. Click the Stethoscope in the Top Right
Step 3. On the bottom click Open Monitor
Step 4. Once Monitor is running go back and run your app
Step 5. Cause your issue to happen
Step 6. Close the app (stop it running)
Step 7. Go to the Monitor and Filter (top right) based on Error, or key word. Find the error line and look at the information Monitor has for why it failed.
Please go to the Request and Response Tabs.
Please copy the request details
Please copy the Response details
--Please make sure to click the > for header and body to make them expand all the details.
Please (email me) if you dont want to share. OR if that shows you the issue and you fix it, please Mark this suggestion as Resolved 🙂
Cheers
If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional