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

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
Super User
Super User

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
Super User
Super User

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

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.

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
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.

Top Kudoed Authors
Users online (2,473)