I have a canvas app that has two separate forms patching data to two different data sources. Form 1 is the parent form and has a one to many relation to the second form. In order for there to be a relationship, I need the same Form ID populated from the parent form to the second form.
Right now, I have the onsuccess property of the parent form to set a variable to the last submitted id:

The ID field of the second form is set to the variable however, it keeps showing up blank.

Not sure how else to get the ID populated, but it shows blank every time the first form is submitted and navigates to the second screen to fill the second form. I should be able to submit the first form, navigate to the second form, and already have the ID populated from the first form that was submitted.
Any thoughts? Please let me know if more information is required.