cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Can't reference Form1.LastSubmit.ID?

@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

19 REPLIES 19
Highlighted
Super User
Super User

Re: Can't reference Form1.LastSubmit.ID?

@notj 

It looks like the way you are referencing the last submitted ID is this.

LastSub.ID

 

However, the typical syntax is this.

your_form_name.LastSubmit.ID

 

Does this fix the problem?  If not, please share your full code and the full error message.

 

I am curious why your initial attempt worked in another app.  If you have any insight here please let me know!

 

---
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."

Highlighted
Post Patron
Post Patron

Re: Can't reference Form1.LastSubmit.ID?

I apologize, the screenshot is misleading. I forgot to mention, I've also tried saving it to a variable and I can't get it to work that way either. The screenshot is that.

 

Here's a more direct screenshot.

Highlighted
Post Patron
Post Patron

Re: Can't reference Form1.LastSubmit.ID?

Whoops, forgot to @ you.  @mdevaney 

Highlighted
Super User
Super User

Re: Can't reference Form1.LastSubmit.ID?

@notj 

Next step is: I want to know what Form1.LastSubmit looks like.

 

Can you please create a button temporarily on your screen and put this code in the OnSelect property.  Post a screenshot of what this looks like in the collections viewer.

ClearCollect(Form1.LastSubmit);

 

If a collection won't work here try a SET variable instead.

Set(myTempVar, Form1.LastSubmit)

 

---
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."

   

Post Patron
Post Patron

Re: Can't reference Form1.LastSubmit.ID?

@mdevaney 

 

It's just empty columns with all the fields that are in the datasource Form1 is connected to. I'm thoroughly confused at this point lol.
The only difference between this OnSuccess and the OnSuccess I'm using in the other app is this one is connected to a CDS data source and the other goes to a SP list.

Highlighted
Post Patron
Post Patron

Re: Can't reference Form1.LastSubmit.ID?

Here's an example of what I mean. I can only target the columns in the data source the form is connected to. 

 

From the second screenshot you can also see there is no available ID field.

Highlighted
Post Patron
Post Patron

Re: Can't reference Form1.LastSubmit.ID?

What's extra weird is the fields I can target don't match what's actually inside Form1. They show me everything in the data source it's connected to. Which would make sense that I can't target ID, because I don't have an ID field in the data source. Why would it be showing me the data source columns instead of the Form1 fields?

 

@mdevaney  any ideas here? I'm lost.

Highlighted
Super User
Super User

Re: Can't reference Form1.LastSubmit.ID?

@notj 

Well, the error message does reference something called cr5be_parentcenum so that's probably why its showing those fields.  Hmmm... where does cr5be come into play within that code block?  Or elsewhere in your code.

 

 

Highlighted
Post Patron
Post Patron

Re: Can't reference Form1.LastSubmit.ID?

@mdevaney  That's the name of the field in the data source I'm trying to patch the LastSubmit.ID to. It's the internal name of the "PArentCERNum" you see in the patch code.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,833)