cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shnurich
Helper II
Helper II

Conditions and Parent.Default on Combobox

Hi guys,

 

I have customized powerapps form on sharepoint and would like to change my Combobox DefaultSelectedItems.

Parent.Default dont work with Conditions.

 

If(SharePointForm1.Mode=New;
If(DataCardValue6.Selected.Title="Test");
Filter(["1";"2"];Value="1");Filter(["1";"2"];Value="2");

Filter(["1";"2"];Value=Parent.Default))

 

Please help to correct code

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @shnurich 

 

Please try this

 

If(
    SharePointForm1.Mode = FormMode.Edit,Parent.Default,
    If(
        DataCardValue6.Selected.Title = "Test",
        {Value: "1"},
        {Value: "2"}
    )
)

 

 
Thanks,
Stalin - Learn To Illuminate

View solution in original post

2 REPLIES 2
StalinPonnusamy
Community Champion
Community Champion

Hi @shnurich 

 

Please try this

 

If(
    SharePointForm1.Mode = FormMode.Edit,Parent.Default,
    If(
        DataCardValue6.Selected.Title = "Test",
        {Value: "1"},
        {Value: "2"}
    )
)

 

 
Thanks,
Stalin - Learn To Illuminate

View solution in original post

v-jefferni
Community Support
Community Support

Hi @shnurich ,

 

I assume you will need Parent.Default in View Mode & Edit Mode of the form, otherwise "1" or "2" base on the DataCardValue6.Selected.Title, so:

If(SharePointForm1.Mode = FormMode.New;
   If(DataCardValue6.Selected.Title="Test";
      {Value:"1"};
      {Value:"2"}
   );
   Parent.Default
)

 

A little modification to @StalinPonnusamy 's codes:

If(
    SharePointForm1.Mode = FormMode.Edit || SharePointForm1.Mode = FormMode.View,
    Parent.Default,
    If(
        DataCardValue6.Selected.Title = "Test",
        {Value: "1"},
        {Value: "2"}
    )
)

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,064)