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 III
Super User III

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 User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (82,116)