cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShadowTech
Post Prodigy
Post Prodigy

Pre-populate a field based on another field in an edit form

Hello,

 

I'm looking to have field "A" populated with data from a SQL table when inputting a number in field "B". I'm working with two different data sources here. The main data source is a SharePoint list where the data from the Edit form will end up but pulling in data from the SQL table.

 

The formula works fine if I switch the mode to "New" but for what ever reason the "Edit" mode throws back an error.

 

If(
    EditForm.Mode = Edit,
    LookUp(
        SQLTable,
        SONumber = DataCardValue45.Text,
        TotalValue
    ),
    ThisItem.'Total Value'
)

 

Any suggestions on how to make this work?

 

Thanks in advance.

2 REPLIES 2
zmorek
Super User
Super User

Try

 

 

If(
    EditForm.Mode = FormMode.Edit,

 

 

Also with the below, are you comparing a number column to a text field? 

SONumber = DataCardValue45.Text,

@zmorek  To question (2), Yes. The SharePoint Field (ThisItem.'Total Value') is a currency field. How can I convert that?

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,575)