cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
olsen9
Resolver II
Resolver II

How to set a fields value on a editform.mode = new (new Screen2) from FormScreen1 etc.

I have an ID Field I'm capturing the data from formscreen1 to create a new item but I cannot set the default value.

 

This ID field already has a value on default but cannot set this value on the new screen

 

I've tried a few options in the default data card but no luck.

 

I've tried setting a variable (varID) and using sharepointform1.selected.ID 

 

 

 

 

5 REPLIES 5
Drrickryp
Super User
Super User

@olsen9 

SharePoint automatically will set the ID field once the data is entered in a New form. You don't need to set it.  Its value doesn't exist until you submit your form.  You can capture it in the OnSuccess property of the form if you wish as Form1.LastSubmit.ID

olsen9
Resolver II
Resolver II

I should have noted that I have a edit form for a parent/child lists within the form.  Within the form, I add a button that says create new list item with a save function.  I want to carry over the ID for list A into List B(create new item)

Drrickryp
Super User
Super User

@olsen9 

In the OnSuccess property after saving the data to the first list, patch the second list and use the formula I showed above to supply the foreign key to the second list.

sorry I'm not saving any data at this point.  I'm just moving data across screens.

Example:  Form1 I'm taking this ID # and clicking add new issue button

olsen9_0-1616078129504.png

 to pass along to Form2 CommonID

Capture.PNG

Drrickryp
Super User
Super User

@olsen9 

I guess I'm confused.  If you have a parent/child relationship, The implication is that the Parent exists before the child can be created.  If the Parent record exists in SharePoint, then it has an ID as this is metadata that is created when the Parent record is created. In that case, hide the dropdown control and put a textinput box in the card.  Set its default property to the name of the control containing the ID in the top form, in your screenshot, something like

DataCardValue1.Text and then make its display mode View or hide it so the user can't change it.  Then make sure the Update property of the card is changed to reflect the new textinput control. 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,349)