cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
notj
Post Prodigy
Post Prodigy

Can't reference Form1.LastSubmit.ID?

Unrelated, but has anyone noticed the PA forums erroring out when creating topics like 50% of the time?

 

Anyhow, I have a form that I submit with a button. In the OnSuccess of the form, I have a patch that I'm trying to reference the forms lastsubmit.ID but it doesn't like the ID part? It gives me a "expected text but found error" message.

 

The wild thing is I have this working in a different app without issue.

 

 

19 REPLIES 19
mdevaney
Super User III
Super User III

@notj 

What happens if you put Form1.LastSubmit.ID in a label?  Does it show any value?

@mdevaney  still can't reference it. Screenshot below:

 

mdevaney
Super User III
Super User III

@notj 

What does the full error message say for ID.  Screenshot please.

@mdevaney 

Same as before:
 2019-12-19 09_48_44-CER - Saved (Unpublished) - Power Apps.png

mdevaney
Super User III
Super User III

@notj 

The ID field in CDS must be named something different then.  What are your columns in CDS.  Show a screenshot if possible.

I have a bunch, but here's the majority of them. You can see the parentcernum field in here as well.

 

Also, even if that field was wrong, it doesn't really explain why I can't target the Form1.LastSubmit.ID at all right? I would just get a "This column doesn't exist" error in my Patch code.

 

 

mdevaney
Super User III
Super User III

@notj 

Actually, I think it does explain why.  SharePoint always has an ID field to track the unique value.  You are using CDS which tracks "ID" in a different column.

 

Your "ID" must be in one of those fields in the screenshot.  I would try these ideas.  Otherwise, you'll have to start digging through CDS to find the appropriate field...

Form1.LastSubmit.CERNum
Form1.LastSubmit.CERNum.ID
Form1.LastSubmit.CERNum.Value

 

View solution in original post

@mdevaney  Ohhhh... OK. Wow, yea that makes sense now. I think it's probably this field then:
2019-12-19 10_09_55-Power Apps.png

 

I'll mess around with it and report back. I think you solved it though.

mdevaney
Super User III
Super User III

@notj 

Bingo!

Form1.LastSubmit.CERLineItems

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

v-xida-msft
Community Support
Community Support

Hi @notj ,

Do you mean that the Edit form is connected to your CDS Entity?

Do you want to patch data from your collLineItems collection to your CERLineItems Entity along with the submitted CERLineItems value?

 

I have made a test on my side, please consider modify your formula as below:

ForAll(
       collLineItems,
       Patch(
              CERLineItems,
              Defaults(CERLineItems),
              {
                Vendor: collLineItems[@vendor],
                ItemDesc: collLineItems[@itemDesc],
                ItemClassification: collLineItems[@classType],
                ...,
                ...,
                ParentCERNum: Form1.LastSubmit.CERLineItems
              }
       )
)

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.

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,441)