cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CarloPrincipe
Level: Powered On

Data Properties Variable

Hi,

 

I'm trying to put a condition to the edit page of my form where in if two or more items (using checkbox) has been selected, the DefaultSelectedItem should be Empty, and if only a single item is chosen, it would populate the edit page with the items current attiributes.

 

However this code i'm using does not seem to work.

 

Snippet:

 

If(
CountRows(selected) > 1,UpdateContext({defaultsuggested:""}),

UpdateContext({defaultsuggested:"Parent.Default"})

)

 

I tried removing the quote on the Parent.Default but it still does not work.

 

img.PNGdefaultfield.PNG

5 REPLIES 5
lucia
Level 8

Re: Data Properties Variable

Hey,

 

where do you have your code snippet?

Super User
Super User

Re: Data Properties Variable

Hi @CarloPrincipe 

 

Parent.Default is not a tring variable and it only works in the context of an element having a parent

 

What you could do is this

If(
CountRows(selected) > 1,UpdateContext({defaultsuggested:""}),

UpdateContext({defaultsuggested:"parent"})

)

 

 

and then in default selected items property 

use If(defaultsuggested = "parent",Parent.Default,defaultsuggested)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

CarloPrincipe
Level: Powered On

Re: Data Properties Variable

Hi @RezaDorrani ,

 

I did what you suggested, but unfortunately I got an error on the data proerties of the field.

 

 

Error on data properties.PNG

Super User
Super User

Re: Data Properties Variable

Hi @CarloPrincipe 

 

For testing, add a label and specify its text property as defaultsuggested 

Juts to check what value is present in defaultsuggested 

 

 

CarloPrincipe
Level: Powered On

Re: Data Properties Variable

Hi @RezaDorrani 

 

As expected, It shows the "parent" when only a single checkbox is checked, but applies "" when multiple items are selected.

 

parent.PNG

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 144 members 3,685 guests
Please welcome our newest community members: