cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mikemaccarthy
Frequent Visitor

ComboBox - DefaultSelectedItems - But differentiate between New & Edit form

I THINK I have set up correctly. Combobox is populating the necessary fields. I have set up MULTIPLE different DefaultSelectedItems options with differing levels of success.

I have used for DefaultselectedItems

Filter(Accounts,ACCOUNT_NAME2 = Account_Name2.Text)

Usually, I have the same editform1 for New or Edit and in Default I use something like 

If(EditForm1.mode = FormMode.New, “  “, ThisItem.XXXXXX)

 

But with Combobox and DefaultSelectedItems.... I don't seem to have the chance of differencing between New and Edit. 

 

I cant watch another yourtube trying to see a solution. Help please!

 

 

11 REPLIES 11

Randy,

Gold Star!

If(!(EditForm1.Mode = New), LookUp(Accounts, ACCOUNT_NAME2 = Coalesce(Parent.Default, Account_Name2.Text)) ...... Sorted it.

I really have no idea how you fixed. I will have to read up now what " If(! " means of does.

Thanks for your help.

M

 

RandyHayes
Super User
Super User

@mikemaccarthy 

The exclamation symbol is a logical NOT shortcut.  So in that case, (EditForm1.Mode=New) will evaluate to either true or false.  The NOT ! will negate it to false or true respectively.  Based on that...the rest of the formula evaluates.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.

Users online (1,203)