cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

If statement, parent default, edit mode and view mode question.

Hi There,

 

I have build a solution for our company which keeps track of all deliveries we receive.

 

I am using Sharepoint to store my data and is combined with a mobile app and SharePoint form.

 

We pulling the client information from SharePoint so we make sure that this field is always up to date.

 

However the main issue I am facing and I cannot figure out is how to display the parent default in Edit mode and view mode. As it can be seen from the images (note that some of the information is blurred since is sensitive data) I cannot populate the Client data field with the parent default. 

 

The CRM information is stored in a collection and is cleared once the entry is saved. The code i am using is below.

 

Client Data Card Value  (Default)  =  If(IsBlank(Client),Parent.Default,If(IsBlank(First(accountTobeAdded).account.'Account Name'),Blank(),First(accountTobeAdded).account.'Account Name'))

 

The client Data Card (Default)= This item.client

The client Data Card (Update) =First(accountTobeAdded).account.'Account Name'

 

Thank you for your help.

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: If statement, parent default, edit mode and view mode question.

HI @Anonymous ,

My response was only addressing your question 
However the main issue I am facing and I cannot figure out is how to display the parent default in Edit mode and view mode. 

I did not look at the rest of you code - so you want the field to have Default mode in View and Edit modes of Parent.Default and your formula in FormMode.New - go the other way - I assume the rest of your formula produces the result you want in FormMode.New.

If(
   SharePointForm1.Mode=FormMode.New,
   If(
      IsBlank(
         First(
            accountTobeAdded
         )
         .account.'Account Name'
      ),
      Blank(),
      First(
         accountTobeAdded
      )
      .account.'Account Name'
   ),
   Parent.Default
)

  

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: If statement, parent default, edit mode and view mode question.

Hi @Anonymous ,
Add this to your code - I will call your form ClientForm - replace with your form name

If(ClientForm.Mode <> FormMode.New, . . . .

This covers the other two modes - Edit and View

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up

Highlighted
Anonymous
Not applicable

Re: If statement, parent default, edit mode and view mode question.

Hi @WarrenBelz,

 

Thank you for your solution.

 

This will not result in an error but it doesn't work for my solution, unfortunately. At this point I am not sure if I am doing something wrong, see code below.

 

If(SharePointForm1.Mode<>FormMode.New,If(IsBlank(First(accountTobeAdded).account.'Account Name'),Blank(),First(accountTobeAdded).account.'Account Name'))

 

Even if I change it to- If(SharePointForm1.Mode<>FormMode.New,IsBlank(First(accountTobeAdded).account.'Account Name'),Blank(),First(accountTobeAdded).account.'Account Name')

 

Will still not work. 

 

 

 

Highlighted
Super User III
Super User III

Re: If statement, parent default, edit mode and view mode question.

HI @Anonymous ,

My response was only addressing your question 
However the main issue I am facing and I cannot figure out is how to display the parent default in Edit mode and view mode. 

I did not look at the rest of you code - so you want the field to have Default mode in View and Edit modes of Parent.Default and your formula in FormMode.New - go the other way - I assume the rest of your formula produces the result you want in FormMode.New.

If(
   SharePointForm1.Mode=FormMode.New,
   If(
      IsBlank(
         First(
            accountTobeAdded
         )
         .account.'Account Name'
      ),
      Blank(),
      First(
         accountTobeAdded
      )
      .account.'Account Name'
   ),
   Parent.Default
)

  

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: If statement, parent default, edit mode and view mode question.

Hi @WarrenBelz,

 

 

That worked flawlessly, I cannot thank you enough for this solution.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,352)