cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simms7400
Post Prodigy
Post Prodigy

How to have a required field but submit nulls?

Hi Team -

 

I have a required field in my PowerApps application.  It is a Combobox of elements I collect from another SP List. What I have also done is add a "Not Applicable" value to the list of items for an end user to select if none of the values are applicable.  The challenge I am facing is I really don't want "Not Applicable" values submitted to my SharePoint list as it looks cluttered and really not best practice.

 

So what I have done is check the "Update" probably for "Not Applicable" and then submit a null however the challenge is when I open the form back open, the value is obviously blank and I need to do the selection over again which I don't want to burden the users.  Is there a way to detect if the field is bull/blank and automatically display "Not Applicable" if so? The other challenge is I think I can get it to display "Not Applicable" if the field is truly blank, but will the Combobox recognize a value without making a selection?

 

Here is my current collection:

	ClearCollect(
        TargetList,
        {
            TargetAlias: "Not Applicable",
			TargetID: "Not Applicable",
            TargetIDR: "Not Applicable"
        },
        ShowColumns(
           AddColumns(
                   Filter(
                         rdTarget,
                                 And(
                                    Not(DataElement_Type.Value = "Time Tracking")//,
                                   // Not(Portfolio_Status.Value = "Terminated")
                                  )
                      ),
                        "TargetIDR",Right(TargetID,8)
            ),
            "TargetAlias",
            "TargetID",
            "TargetIDR",
            "DDU_Portfolio",
            "Modality_Detail",
            "Target_Short_Name",
            "Target_Long_Name",
            "Business_Owner",
            "Mechanism",
            "IP_Owner"
        )
    )

 

Here is my DefaultSelectedItems property (which is Displaying "TargetAlias":

LookUp(TargetList,TargetIDR=ThisItem.PF_Research_Code)

 

Any tips are greatly appreciated, thank you!

 

5 REPLIES 5
Knivy
Frequent Visitor

Hi,

Assuming you're wanting the combobox default to display 'Not Applicable' then try this code:

If(IsBlank(LookUp(TargetList, TargetIDR=ThisItem.PF_Research_Code)),"Not Applicable",LookUp(TargetList, TargetIDR=ThisItem.PF_Research_Code))

OR

If(LookUp(TargetList, TargetIDR=ThisItem.PF_Research_Code)="","Not Applicable",LookUp(TargetList, TargetIDR=ThisItem.PF_Research_Code))

Hopefully this helps you!

@Knivy  Thanks! Where would I put this? In the ComboBox default selected items? Both formulas don't seem to work.  One is saying need text value while the other the syntax is wrong.

 

 

Knivy
Frequent Visitor

My bad! I didn't completely understand what the combobox was doing!

I think this may work in the combo box default selected items:

If(IsEmpty(LookUp(TargetList, TargetIDR=ThisItem.PF_Research_Code)), LookUp(TargetList, TargetIDR="Not Applicable"),LookUp(TargetList, TargetIDR=ThisItem.PF_Research_Code))

But if it doesn't then I can't help any further I'm afriad and will need someone more skilled than me to take a look

@Knivy  Thanks! It works in the ComboBox but doesn't actually Display "Not Applicable". I believe I would need to do something int he Default and UPdate fields as well but not sure

Hi folks, would anyone perhaps have any other ideas? Thank you!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,205)