cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GregorBecker
New Member

Load existing list item while creating new one

Given a sharepoint list customized with PowerApps the "new" form should have a textfield and button on the top to load the values of an existing list item into the new form. The user should be able to change the values afterwards.

 

Textfield-Name: QLRev

Button OnSelect formular: UpdateContext({RevItem:LookUp('MyList';'Number' = QLRev.Text)})

 

How can I now apply the values from the variable "RevItem" to the form fields? 

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @GregorBecker ,

Make the Default of the control (I assume a Text Box)

If(
   YourFormName.Mode=FormMode.New,
   RevItem,
   Parent.Default
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

GregorBecker
New Member

@WarrenBelz I changed the value as you mentioned and now loading a reference is working. But the default values of the list now doesn't show when opening the new form and not loading a reference. 

 

I tried to Prefill RevItem with Lists Defaults which doesn't work:

App OnSTart Function: Set(RevItem; Defaults('MyList'))

Hi @GregorBecker ,

You now have two completely different (which I must emphasise) RevItem variables - one Global from your Set command and the second Context ( Original) item.

I am not sure what you are trying to do with the first one, but my response was in relation to the second original item There is no need to set a variable to the Defaults of a list as a form does this automatically.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @GregorBecker ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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