cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wally0114
Regular Visitor

Duplicating Data

So i have a line in my app that is a Number i want that number to automatically be inputted to the number line of a new form when the new form is created. how would i do that?

3 ACCEPTED SOLUTIONS

Accepted Solutions
Drrickryp
Super User
Super User

@Wally0114 

Assuming you are using a form to create a new record, in the default property of the control inside the card for your number: Coalesce(Parent.Default, yournumber) . 

The Coalesce() function reads the elements from left to right until a nonBlank one is found. In a new form, the Parent.Default will be blank and yournumber will be inserted.  If the form is in edit mode, there will be a Parent.Default and it will be the one in the control.

A common use is to assign the next ID number in a series so in that case,

Coalesce(Parent.Default, First(Sort(table, ID, Descending)).ID+1)  will assign the next ID number regardless of the number of records in a list. 

View solution in original post

Wally0114
Regular Visitor

@Drrickryp So the purpose of this app is to sign families up for a non-profit toy give away. each family is given a number called the ( Family Number) in the app. i have a button on the registration form that is to add children's information i want the family number that is given on the parent form to automatically go onto the Childs form when the button is pushed and a new child info form is created.

 

View solution in original post

@Wally0114 

It will work well in this case.  Coalesce(Parent.Default, FamilyNumber)  if the family number is coming from a gallery, you would use Coalesce(Parent.Default, Gallery1.Selected.FamilyNumber)

View solution in original post

5 REPLIES 5
Drrickryp
Super User
Super User

@Wally0114 

Assuming you are using a form to create a new record, in the default property of the control inside the card for your number: Coalesce(Parent.Default, yournumber) . 

The Coalesce() function reads the elements from left to right until a nonBlank one is found. In a new form, the Parent.Default will be blank and yournumber will be inserted.  If the form is in edit mode, there will be a Parent.Default and it will be the one in the control.

A common use is to assign the next ID number in a series so in that case,

Coalesce(Parent.Default, First(Sort(table, ID, Descending)).ID+1)  will assign the next ID number regardless of the number of records in a list. 

Wally0114
Regular Visitor

@Drrickryp So the purpose of this app is to sign families up for a non-profit toy give away. each family is given a number called the ( Family Number) in the app. i have a button on the registration form that is to add children's information i want the family number that is given on the parent form to automatically go onto the Childs form when the button is pushed and a new child info form is created.

 

@Wally0114 

It will work well in this case.  Coalesce(Parent.Default, FamilyNumber)  if the family number is coming from a gallery, you would use Coalesce(Parent.Default, Gallery1.Selected.FamilyNumber)

@Drrickryp Thank you. 

 

Drrickryp
Super User
Super User

@Wally0114 

Glad to help a worthy cause.  You should hide this card so a user can't change it. _ToyIgor.jpg

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,183)