cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Michaelcwang2
Frequent Visitor

"Could not find list item" by initializing variable through "EditForm1.LastSubmit.Identifier".

I'm working on an App to share a link of uploaded picture back to SharePoint List by creating an Automate when the image is clicked like picture attached.Editform1.LastSubmitEditform1.LastSubmit

 And the Automate is designed as below:AutomateUpdateItemAutomateUpdateItemSo once executed, the variable initialized and all input collected but error message 404 shows.

initialize variableinitialize variableUpdate itemUpdate item

So if suggestion where went wrong.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Michaelcwang2 ,

Do you want to pass the EditForm1.LastSubmit.Identifier formula result as Item ID to your flow?

 

Based on the screenshot that you mentioned, I think there is something wrong with the List Item ID you passed from your canvas app through the EditForm1.LastSubmit.Identifier formula.

 

According to the "initialize variable" screen, I find that the List Item ID value you retrieved from your canvas app is 0 (zero), but in a SP List, the List Item ID (System field, auto-populated by SharePoint server) is starting from 1. So I think there is something wrong with the EditForm1.LastSubmit.Identifier formula result.

 

Actually, the EditForm1.LastSubmit formula would be populated with proper record value only after you submit your Edit form successfully. If your Edit form is in New mode, or you do not submit your Edit form data or your Edit form has been reset, the EditForm1.LastSubmit formula would be blank, the EditForm1.LastSubmit.Identifier formula would be Blank.

 

If you are editing an existing record in your SP List, please modify your formula within the OnSelect property of the Image control as below:

UploadaphotoandcreatealinktoSharePointfromPowerApps.Run(
                                                        Subtitle2.Text,
                                                        MyCamera.Photo,
                                                        BrowseGallery1.Selected.'識別碼 ({Identifier})'
)

Note: I assume that the '識別碼 ({Identifier})' represents the ID column (List Item ID) in your SP List. The BrowseGallery1 represents the Gallery in your app, please replace it with actual Gallery name.

 

If you are creating a new entry in your SP list, the List Item ID value would not be generated until you submitted your form data to your SP List successfully. So you should submit your form data back to your SP List firstly. Please consider set the OnSuccess property of the Edit form to following:

Set(ListItemID, EditForm1.LastSubmit.'識別碼 ({Identifier})'); // Add this formula to store the List item ID into a variable when you submit your form data

Then you could reference the List Item ID value of the created List Item through this variable in your UploadaphotoandcreatealinktoSharePointfromPowerApps.Run() function:

UploadaphotoandcreatealinktoSharePointfromPowerApps.Run(
                                                        Subtitle2.Text,
                                                        MyCamera.Photo,
                                                        ListItemID ({Identifier})'
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @Michaelcwang2 ,

Do you want to pass the EditForm1.LastSubmit.Identifier formula result as Item ID to your flow?

 

Based on the screenshot that you mentioned, I think there is something wrong with the List Item ID you passed from your canvas app through the EditForm1.LastSubmit.Identifier formula.

 

According to the "initialize variable" screen, I find that the List Item ID value you retrieved from your canvas app is 0 (zero), but in a SP List, the List Item ID (System field, auto-populated by SharePoint server) is starting from 1. So I think there is something wrong with the EditForm1.LastSubmit.Identifier formula result.

 

Actually, the EditForm1.LastSubmit formula would be populated with proper record value only after you submit your Edit form successfully. If your Edit form is in New mode, or you do not submit your Edit form data or your Edit form has been reset, the EditForm1.LastSubmit formula would be blank, the EditForm1.LastSubmit.Identifier formula would be Blank.

 

If you are editing an existing record in your SP List, please modify your formula within the OnSelect property of the Image control as below:

UploadaphotoandcreatealinktoSharePointfromPowerApps.Run(
                                                        Subtitle2.Text,
                                                        MyCamera.Photo,
                                                        BrowseGallery1.Selected.'識別碼 ({Identifier})'
)

Note: I assume that the '識別碼 ({Identifier})' represents the ID column (List Item ID) in your SP List. The BrowseGallery1 represents the Gallery in your app, please replace it with actual Gallery name.

 

If you are creating a new entry in your SP list, the List Item ID value would not be generated until you submitted your form data to your SP List successfully. So you should submit your form data back to your SP List firstly. Please consider set the OnSuccess property of the Edit form to following:

Set(ListItemID, EditForm1.LastSubmit.'識別碼 ({Identifier})'); // Add this formula to store the List item ID into a variable when you submit your form data

Then you could reference the List Item ID value of the created List Item through this variable in your UploadaphotoandcreatealinktoSharePointfromPowerApps.Run() function:

UploadaphotoandcreatealinktoSharePointfromPowerApps.Run(
                                                        Subtitle2.Text,
                                                        MyCamera.Photo,
                                                        ListItemID ({Identifier})'
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-xida-msft 

Appreciate your comment and you were right that item "0" didn't make sense so I found and change to "Id" instead of "Identifier" but truly appreciate your overall review.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,689)