web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default Field dependin...
Power Apps
Answered

Default Field depending on other field not getting populated in New Mode

(0) ShareShare
ReportReport
Posted on by 65

Im struggling to understand why my field is not getting populated on a new sharepoint form:

 

 

#('Regions' is a separate List to control the assigment of Countries to Regions)
#Country Field
DefaultSelectedItems:
If(
 'Form_Certification_Process_Basic-Info'.Mode=FormMode.New;
 {
		Value: Office365Users.UserProfileV2(User().Email).country
	};
 Parent.Default
)
Items:
Filter(
 ('Regions');!IsBlank(Country)
).Country

#Region Field 
DefaultSelectedItems:
If(
 'Form_Certification_Process_Basic-Info'.Mode=FormMode.New;
 {
		Value: LookUp('Regions'; Country = Country_DataCardValue.Selected.Country;Region.Value)
	};
 Parent.Default
)
Items:
Choices([@'Regions'].Region)

 

 So the country Field gets populated with the Country of the currently logged in User. This works as intended. 
But somehow the Region Field stays empty when i start or reset the form.  - however it has a value when I change or update the Country field (can be the same value). Can someone explain why? Do i have to add some sort of delay until my Country field is populated?

Categories:
  • Verified answer
    Ashwin7104 Profile Picture
    671 on at

    Hey @Lephas ,

     

    Can you try below code and see if it works. I would recommend to store logged in user country to a global variable and use it across controls

     

    // App On-start or screen on visible
    Set(UserCountry,Office365Users.UserProfileV2(User().Email).country);
    // OnChange property of country dropdown
    
    Set(UserCountry, Country_DataCardValue.Selected.Country);

     

    #('Regions' is a separate List to control the assigment of Countries to Regions)
    #Country Field
    DefaultSelectedItems:
    If(
     'Form_Certification_Process_Basic-Info'.Mode=FormMode.New;
     {
    		Value: UserCountry
    	};
     Parent.Default
    )
    Items:
    Filter(
     ('Regions');!IsBlank(Country)
    ).Country
    
    #Region Field 
    DefaultSelectedItems:
    If(
     'Form_Certification_Process_Basic-Info'.Mode=FormMode.New;
     {
    		Value: LookUp('Regions'; Country = UserCountry;Region.Value)
    	};
     Parent.Default
    )
    Items:
    Choices([@'Regions'].Region)

     

     

  • Lephas Profile Picture
    65 on at

    Thanks a lot . While i did not use your exact code - your tipp about using variables helped me a lot. I stored those user information in a global variable and this way everything works as intended!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard